diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 29e9b5527f94..85eb6a3a1f0b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -336,7 +336,7 @@ com.azure.resourcemanager:azure-resourcemanager-appconfiguration;1.1.0;1.2.0-bet com.azure.resourcemanager:azure-resourcemanager-attestation;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-azurestack;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-azurestackhci;1.0.0-beta.5;1.0.0-beta.6 -com.azure.resourcemanager:azure-resourcemanager-avs;1.3.0;1.4.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-avs;1.3.0;1.4.0 com.azure.resourcemanager:azure-resourcemanager-consumption;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-commerce;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-billing;1.0.0;1.1.0-beta.1 diff --git a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md index 6465dbbd20e4..f70054540ae5 100644 --- a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md +++ b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md @@ -1,14 +1,128 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.4.0 (2025-10-21) + +- Azure Resource Manager Avs client library for Java. This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package api-version 2025-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.ImpactedMaintenanceResource` was added + +* `models.License` was added + +* `models.AvailableWindowForMaintenanceWhileScheduleOperation` was added + +* `models.MaintenanceStateName` was added + +* `models.MaintenanceSchedule` was added + +* `models.MaintenanceReadinessStatus` was added + +* `models.License$Update` was added + +* `models.BlockedDatesConstraintCategory` was added + +* `models.MaintenanceState` was added + +* `models.License$UpdateStages` was added + +* `models.SchedulingWindow` was added + +* `models.Licenses` was added + +* `models.MaintenanceType` was added + +* `models.LicenseKind` was added + +* `models.RescheduleOperationConstraint` was added + +* `models.MaintenanceProvisioningState` was added + +* `models.BlockedDatesConstraintTimeRange` was added + +* `models.RescheduleOperationConstraintKind` was added + +* `models.Vcf5License` was added + +* `models.MaintenanceReadinessRefreshOperationStatus` was added + +* `models.Maintenances` was added + +* `models.VmwareFirewallLicenseProperties` was added + +* `models.ScheduleOperationConstraintKind` was added + +* `models.ScheduleOperation` was added + +* `models.RescheduleOperation` was added + +* `models.VcfLicenseKind` was added + +* `models.LicenseName` was added + +* `models.License$DefinitionStages` was added + +* `models.Maintenance` was added -### Bugs Fixed +* `models.MaintenanceCheckType` was added + +* `models.PrivateCloudProperties` was added + +* `models.MaintenanceReschedule` was added + +* `models.License$Definition` was added + +* `models.MaintenanceManagementOperationKind` was added + +* `models.BlockedWhileScheduleOperation` was added + +* `models.Label` was added + +* `models.MaintenanceManagementOperation` was added + +* `models.ScheduleOperationConstraint` was added + +* `models.VcfLicense` was added + +* `models.AvailableWindowForMaintenanceWhileRescheduleOperation` was added + +* `models.BlockedWhileRescheduleOperation` was added + +* `models.LicenseProperties` was added + +* `models.MaintenanceProperties` was added + +* `models.LicenseProvisioningState` was added + +* `models.MaintenanceReadinessRefreshOperation` was added + +* `models.MaintenanceStatusFilter` was added + +* `models.MaintenanceReadiness` was added + +* `models.MaintenanceFailedCheck` was added + +* `models.ImpactedMaintenanceResourceError` was added + +#### `models.PrivateClouds` was modified + +* `getVcfLicense(java.lang.String,java.lang.String)` was added +* `getVcfLicenseWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `AvsManager` was modified + +* `licenses()` was added +* `maintenances()` was added + +#### `models.PrivateCloud$Definition` was modified + +* `withVcfLicense(fluent.models.VcfLicenseInner)` was added + +#### `models.PrivateCloud` was modified -### Other Changes +* `getVcfLicense()` was added +* `vcfLicense()` was added +* `getVcfLicenseWithResponse(com.azure.core.util.Context)` was added ## 1.3.0 (2025-07-08) diff --git a/sdk/avs/azure-resourcemanager-avs/README.md b/sdk/avs/azure-resourcemanager-avs/README.md index 70caabe6fb0e..bc30048fa05a 100644 --- a/sdk/avs/azure-resourcemanager-avs/README.md +++ b/sdk/avs/azure-resourcemanager-avs/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Avs client library for Java. -This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package api-version 2024-09-01. 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 Avs Management SDK. Azure VMware Solution API. Package api-version 2025-09-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-avs - 1.3.0 + 1.4.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/avs/azure-resourcemanager-avs/SAMPLE.md b/sdk/avs/azure-resourcemanager-avs/SAMPLE.md index 35a74f3adff2..72018aa5ded0 100644 --- a/sdk/avs/azure-resourcemanager-avs/SAMPLE.md +++ b/sdk/avs/azure-resourcemanager-avs/SAMPLE.md @@ -64,11 +64,27 @@ - [Get](#iscsipaths_get) - [ListByPrivateCloud](#iscsipaths_listbyprivatecloud) +## Licenses + +- [CreateOrUpdate](#licenses_createorupdate) +- [Delete](#licenses_delete) +- [Get](#licenses_get) +- [GetProperties](#licenses_getproperties) +- [List](#licenses_list) + ## Locations - [CheckQuotaAvailability](#locations_checkquotaavailability) - [CheckTrialAvailability](#locations_checktrialavailability) +## Maintenances + +- [Get](#maintenances_get) +- [InitiateChecks](#maintenances_initiatechecks) +- [List](#maintenances_list) +- [Reschedule](#maintenances_reschedule) +- [Schedule](#maintenances_schedule) + ## Operations - [List](#operations_list) @@ -86,6 +102,7 @@ - [CreateOrUpdate](#privateclouds_createorupdate) - [Delete](#privateclouds_delete) - [GetByResourceGroup](#privateclouds_getbyresourcegroup) +- [GetVcfLicense](#privateclouds_getvcflicense) - [List](#privateclouds_list) - [ListAdminCredentials](#privateclouds_listadmincredentials) - [ListByResourceGroup](#privateclouds_listbyresourcegroup) @@ -188,7 +205,7 @@ import com.azure.resourcemanager.avs.models.AddonVrProperties; */ public final class AddonsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_HCX.json + * x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX.json */ /** * Sample code: Addons_CreateOrUpdate_HCX. @@ -204,7 +221,7 @@ public final class AddonsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_SRM.json + * x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_SRM.json */ /** * Sample code: Addons_CreateOrUpdate_SRM. @@ -220,7 +237,7 @@ public final class AddonsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json + * x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json */ /** * Sample code: Addons_CreateOrUpdate_HCX_With_Networks. @@ -238,7 +255,7 @@ public final class AddonsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_ArcReg.json + * x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_ArcReg.json */ /** * Sample code: Addons_CreateOrUpdate_ArcReg. @@ -255,7 +272,7 @@ public final class AddonsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_CreateOrUpdate_VR.json + * x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_VR.json */ /** * Sample code: Addons_CreateOrUpdate_VR. @@ -280,7 +297,7 @@ public final class AddonsCreateOrUpdateSamples { */ public final class AddonsDeleteSamples { /* - * x-ms-original-file: 2024-09-01/Addons_Delete.json + * x-ms-original-file: 2025-09-01/Addons_Delete.json */ /** * Sample code: Addons_Delete. @@ -301,7 +318,7 @@ public final class AddonsDeleteSamples { */ public final class AddonsGetSamples { /* - * x-ms-original-file: 2024-09-01/Addons_Get_HCX_With_Networks.json + * x-ms-original-file: 2025-09-01/Addons_Get_HCX_With_Networks.json */ /** * Sample code: Addons_Get_HCX_With_Networks. @@ -313,7 +330,7 @@ public final class AddonsGetSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_Get_SRM.json + * x-ms-original-file: 2025-09-01/Addons_Get_SRM.json */ /** * Sample code: Addons_Get_SRM. @@ -325,7 +342,7 @@ public final class AddonsGetSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_Get_VR.json + * x-ms-original-file: 2025-09-01/Addons_Get_VR.json */ /** * Sample code: Addons_Get_VR. @@ -337,7 +354,7 @@ public final class AddonsGetSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_Get_HCX.json + * x-ms-original-file: 2025-09-01/Addons_Get_HCX.json */ /** * Sample code: Addons_Get_HCX. @@ -349,7 +366,7 @@ public final class AddonsGetSamples { } /* - * x-ms-original-file: 2024-09-01/Addons_Get_ArcReg.json + * x-ms-original-file: 2025-09-01/Addons_Get_ArcReg.json */ /** * Sample code: Addons_Get_ArcReg. @@ -370,7 +387,7 @@ public final class AddonsGetSamples { */ public final class AddonsListSamples { /* - * x-ms-original-file: 2024-09-01/Addons_List.json + * x-ms-original-file: 2025-09-01/Addons_List.json */ /** * Sample code: Addons_List. @@ -391,7 +408,7 @@ public final class AddonsListSamples { */ public final class AuthorizationsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/Authorizations_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/Authorizations_CreateOrUpdate.json */ /** * Sample code: Authorizations_CreateOrUpdate. @@ -412,7 +429,7 @@ public final class AuthorizationsCreateOrUpdateSamples { */ public final class AuthorizationsDeleteSamples { /* - * x-ms-original-file: 2024-09-01/Authorizations_Delete.json + * x-ms-original-file: 2025-09-01/Authorizations_Delete.json */ /** * Sample code: Authorizations_Delete. @@ -433,7 +450,7 @@ public final class AuthorizationsDeleteSamples { */ public final class AuthorizationsGetSamples { /* - * x-ms-original-file: 2024-09-01/Authorizations_Get.json + * x-ms-original-file: 2025-09-01/Authorizations_Get.json */ /** * Sample code: Authorizations_Get. @@ -455,7 +472,7 @@ public final class AuthorizationsGetSamples { */ public final class AuthorizationsListSamples { /* - * x-ms-original-file: 2024-09-01/Authorizations_List.json + * x-ms-original-file: 2025-09-01/Authorizations_List.json */ /** * Sample code: Authorizations_List. @@ -476,7 +493,7 @@ public final class AuthorizationsListSamples { */ public final class CloudLinksCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/CloudLinks_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/CloudLinks_CreateOrUpdate.json */ /** * Sample code: CloudLinks_CreateOrUpdate. @@ -502,7 +519,7 @@ public final class CloudLinksCreateOrUpdateSamples { */ public final class CloudLinksDeleteSamples { /* - * x-ms-original-file: 2024-09-01/CloudLinks_Delete.json + * x-ms-original-file: 2025-09-01/CloudLinks_Delete.json */ /** * Sample code: CloudLinks_Delete. @@ -523,7 +540,7 @@ public final class CloudLinksDeleteSamples { */ public final class CloudLinksGetSamples { /* - * x-ms-original-file: 2024-09-01/CloudLinks_Get.json + * x-ms-original-file: 2025-09-01/CloudLinks_Get.json */ /** * Sample code: CloudLinks_Get. @@ -544,7 +561,7 @@ public final class CloudLinksGetSamples { */ public final class CloudLinksListSamples { /* - * x-ms-original-file: 2024-09-01/CloudLinks_List.json + * x-ms-original-file: 2025-09-01/CloudLinks_List.json */ /** * Sample code: CloudLinks_List. @@ -567,7 +584,7 @@ import com.azure.resourcemanager.avs.models.Sku; */ public final class ClustersCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/Clusters_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/Clusters_CreateOrUpdate.json */ /** * Sample code: Clusters_CreateOrUpdate. @@ -593,7 +610,7 @@ public final class ClustersCreateOrUpdateSamples { */ public final class ClustersDeleteSamples { /* - * x-ms-original-file: 2024-09-01/Clusters_Delete.json + * x-ms-original-file: 2025-09-01/Clusters_Delete.json */ /** * Sample code: Clusters_Delete. @@ -614,7 +631,7 @@ public final class ClustersDeleteSamples { */ public final class ClustersGetSamples { /* - * x-ms-original-file: 2024-09-01/Clusters_Get.json + * x-ms-original-file: 2025-09-01/Clusters_Get.json */ /** * Sample code: Clusters_Get. @@ -635,7 +652,7 @@ public final class ClustersGetSamples { */ public final class ClustersListSamples { /* - * x-ms-original-file: 2024-09-01/Clusters_List.json + * x-ms-original-file: 2025-09-01/Clusters_List.json */ /** * Sample code: Clusters_List. @@ -656,7 +673,7 @@ public final class ClustersListSamples { */ public final class ClustersListZonesSamples { /* - * x-ms-original-file: 2024-09-01/Clusters_ListZones.json + * x-ms-original-file: 2025-09-01/Clusters_ListZones.json */ /** * Sample code: Clusters_ListZones. @@ -668,7 +685,7 @@ public final class ClustersListZonesSamples { } /* - * x-ms-original-file: 2024-09-01/Clusters_ListZones_Stretched.json + * x-ms-original-file: 2025-09-01/Clusters_ListZones_Stretched.json */ /** * Sample code: Clusters_ListZones_Stretched. @@ -691,7 +708,7 @@ import com.azure.resourcemanager.avs.models.Cluster; */ public final class ClustersUpdateSamples { /* - * x-ms-original-file: 2024-09-01/Clusters_Update.json + * x-ms-original-file: 2025-09-01/Clusters_Update.json */ /** * Sample code: Clusters_Update. @@ -717,7 +734,7 @@ import com.azure.resourcemanager.avs.models.NetAppVolume; */ public final class DatastoresCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/Datastores_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/Datastores_CreateOrUpdate.json */ /** * Sample code: Datastores_CreateOrUpdate. @@ -743,7 +760,7 @@ public final class DatastoresCreateOrUpdateSamples { */ public final class DatastoresDeleteSamples { /* - * x-ms-original-file: 2024-09-01/Datastores_Delete.json + * x-ms-original-file: 2025-09-01/Datastores_Delete.json */ /** * Sample code: Datastores_Delete. @@ -764,7 +781,7 @@ public final class DatastoresDeleteSamples { */ public final class DatastoresGetSamples { /* - * x-ms-original-file: 2024-09-01/Datastores_Get.json + * x-ms-original-file: 2025-09-01/Datastores_Get.json */ /** * Sample code: Datastores_Get. @@ -786,7 +803,7 @@ public final class DatastoresGetSamples { */ public final class DatastoresListSamples { /* - * x-ms-original-file: 2024-09-01/Datastores_List.json + * x-ms-original-file: 2025-09-01/Datastores_List.json */ /** * Sample code: Datastores_List. @@ -807,7 +824,7 @@ public final class DatastoresListSamples { */ public final class GlobalReachConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/GlobalReachConnections_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/GlobalReachConnections_CreateOrUpdate.json */ /** * Sample code: GlobalReachConnections_CreateOrUpdate. @@ -834,7 +851,7 @@ public final class GlobalReachConnectionsCreateOrUpdateSamples { */ public final class GlobalReachConnectionsDeleteSamples { /* - * x-ms-original-file: 2024-09-01/GlobalReachConnections_Delete.json + * x-ms-original-file: 2025-09-01/GlobalReachConnections_Delete.json */ /** * Sample code: GlobalReachConnections_Delete. @@ -855,7 +872,7 @@ public final class GlobalReachConnectionsDeleteSamples { */ public final class GlobalReachConnectionsGetSamples { /* - * x-ms-original-file: 2024-09-01/GlobalReachConnections_Get.json + * x-ms-original-file: 2025-09-01/GlobalReachConnections_Get.json */ /** * Sample code: GlobalReachConnections_Get. @@ -877,7 +894,7 @@ public final class GlobalReachConnectionsGetSamples { */ public final class GlobalReachConnectionsListSamples { /* - * x-ms-original-file: 2024-09-01/GlobalReachConnections_List.json + * x-ms-original-file: 2025-09-01/GlobalReachConnections_List.json */ /** * Sample code: GlobalReachConnections_List. @@ -898,7 +915,7 @@ public final class GlobalReachConnectionsListSamples { */ public final class HcxEnterpriseSitesCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/HcxEnterpriseSites_CreateOrUpdate.json */ /** * Sample code: HcxEnterpriseSites_CreateOrUpdate. @@ -919,7 +936,7 @@ public final class HcxEnterpriseSitesCreateOrUpdateSamples { */ public final class HcxEnterpriseSitesDeleteSamples { /* - * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_Delete.json + * x-ms-original-file: 2025-09-01/HcxEnterpriseSites_Delete.json */ /** * Sample code: HcxEnterpriseSites_Delete. @@ -940,7 +957,7 @@ public final class HcxEnterpriseSitesDeleteSamples { */ public final class HcxEnterpriseSitesGetSamples { /* - * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_Get.json + * x-ms-original-file: 2025-09-01/HcxEnterpriseSites_Get.json */ /** * Sample code: HcxEnterpriseSites_Get. @@ -961,7 +978,7 @@ public final class HcxEnterpriseSitesGetSamples { */ public final class HcxEnterpriseSitesListSamples { /* - * x-ms-original-file: 2024-09-01/HcxEnterpriseSites_List.json + * x-ms-original-file: 2025-09-01/HcxEnterpriseSites_List.json */ /** * Sample code: HcxEnterpriseSites_List. @@ -982,7 +999,7 @@ public final class HcxEnterpriseSitesListSamples { */ public final class HostsGetSamples { /* - * x-ms-original-file: 2024-09-01/Hosts_Get.json + * x-ms-original-file: 2025-09-01/Hosts_Get.json */ /** * Sample code: Hosts_Get. @@ -1005,7 +1022,7 @@ public final class HostsGetSamples { */ public final class HostsListSamples { /* - * x-ms-original-file: 2024-09-01/Hosts_List.json + * x-ms-original-file: 2025-09-01/Hosts_List.json */ /** * Sample code: Hosts_List. @@ -1028,7 +1045,7 @@ import com.azure.resourcemanager.avs.fluent.models.IscsiPathInner; */ public final class IscsiPathsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/IscsiPaths_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/IscsiPaths_CreateOrUpdate.json */ /** * Sample code: IscsiPaths_CreateOrUpdate. @@ -1051,7 +1068,7 @@ public final class IscsiPathsCreateOrUpdateSamples { */ public final class IscsiPathsDeleteSamples { /* - * x-ms-original-file: 2024-09-01/IscsiPaths_Delete.json + * x-ms-original-file: 2025-09-01/IscsiPaths_Delete.json */ /** * Sample code: IscsiPaths_Delete. @@ -1072,7 +1089,7 @@ public final class IscsiPathsDeleteSamples { */ public final class IscsiPathsGetSamples { /* - * x-ms-original-file: 2024-09-01/IscsiPaths_Get.json + * x-ms-original-file: 2025-09-01/IscsiPaths_Get.json */ /** * Sample code: IscsiPaths_Get. @@ -1093,7 +1110,7 @@ public final class IscsiPathsGetSamples { */ public final class IscsiPathsListByPrivateCloudSamples { /* - * x-ms-original-file: 2024-09-01/IscsiPaths_List.json + * x-ms-original-file: 2025-09-01/IscsiPaths_List.json */ /** * Sample code: IscsiPaths_ListByPrivateCloud. @@ -1106,6 +1123,122 @@ public final class IscsiPathsListByPrivateCloudSamples { } ``` +### Licenses_CreateOrUpdate + +```java +import com.azure.resourcemanager.avs.models.LicenseName; + +/** + * Samples for Licenses CreateOrUpdate. + */ +public final class LicensesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-09-01/Licenses_CreateOrUpdate.json + */ + /** + * Sample code: Licenses_CreateOrUpdate. + * + * @param manager Entry point to AvsManager. + */ + public static void licensesCreateOrUpdate(com.azure.resourcemanager.avs.AvsManager manager) { + manager.licenses().define(LicenseName.VMWARE_FIREWALL).withExistingPrivateCloud("group1", "cloud1").create(); + } +} +``` + +### Licenses_Delete + +```java +import com.azure.resourcemanager.avs.models.LicenseName; + +/** + * Samples for Licenses Delete. + */ +public final class LicensesDeleteSamples { + /* + * x-ms-original-file: 2025-09-01/Licenses_Delete.json + */ + /** + * Sample code: Licenses_Delete. + * + * @param manager Entry point to AvsManager. + */ + public static void licensesDelete(com.azure.resourcemanager.avs.AvsManager manager) { + manager.licenses().delete("group1", "cloud1", LicenseName.VMWARE_FIREWALL, com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_Get + +```java +import com.azure.resourcemanager.avs.models.LicenseName; + +/** + * Samples for Licenses Get. + */ +public final class LicensesGetSamples { + /* + * x-ms-original-file: 2025-09-01/Licenses_Get.json + */ + /** + * Sample code: Licenses_Get. + * + * @param manager Entry point to AvsManager. + */ + public static void licensesGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.licenses() + .getWithResponse("group1", "cloud1", LicenseName.VMWARE_FIREWALL, com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_GetProperties + +```java +import com.azure.resourcemanager.avs.models.LicenseName; + +/** + * Samples for Licenses GetProperties. + */ +public final class LicensesGetPropertiesSamples { + /* + * x-ms-original-file: 2025-09-01/Licenses_GetProperties.json + */ + /** + * Sample code: Licenses_GetProperties. + * + * @param manager Entry point to AvsManager. + */ + public static void licensesGetProperties(com.azure.resourcemanager.avs.AvsManager manager) { + manager.licenses() + .getPropertiesWithResponse("group1", "cloud1", LicenseName.VMWARE_FIREWALL, + com.azure.core.util.Context.NONE); + } +} +``` + +### Licenses_List + +```java +/** + * Samples for Licenses List. + */ +public final class LicensesListSamples { + /* + * x-ms-original-file: 2025-09-01/Licenses_List.json + */ + /** + * Sample code: Licenses_List. + * + * @param manager Entry point to AvsManager. + */ + public static void licensesList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.licenses().list("group1", "cloud1", com.azure.core.util.Context.NONE); + } +} +``` + ### Locations_CheckQuotaAvailability ```java @@ -1114,7 +1247,7 @@ public final class IscsiPathsListByPrivateCloudSamples { */ public final class LocationsCheckQuotaAvailabilitySamples { /* - * x-ms-original-file: 2024-09-01/Locations_CheckQuotaAvailability.json + * x-ms-original-file: 2025-09-01/Locations_CheckQuotaAvailability.json */ /** * Sample code: Locations_CheckQuotaAvailability. @@ -1137,7 +1270,7 @@ import com.azure.resourcemanager.avs.models.Sku; */ public final class LocationsCheckTrialAvailabilitySamples { /* - * x-ms-original-file: 2024-09-01/Locations_CheckTrialAvailability.json + * x-ms-original-file: 2025-09-01/Locations_CheckTrialAvailability.json */ /** * Sample code: Locations_CheckTrialAvailability. @@ -1149,7 +1282,7 @@ public final class LocationsCheckTrialAvailabilitySamples { } /* - * x-ms-original-file: 2024-09-01/Locations_CheckTrialAvailabilityWithSku.json + * x-ms-original-file: 2025-09-01/Locations_CheckTrialAvailabilityWithSku.json */ /** * Sample code: Locations_CheckTrialAvailabilityWithSku. @@ -1164,6 +1297,127 @@ public final class LocationsCheckTrialAvailabilitySamples { } ``` +### Maintenances_Get + +```java +/** + * Samples for Maintenances Get. + */ +public final class MaintenancesGetSamples { + /* + * x-ms-original-file: 2025-09-01/Maintenances_Get.json + */ + /** + * Sample code: Maintenances_Get. + * + * @param manager Entry point to AvsManager. + */ + public static void maintenancesGet(com.azure.resourcemanager.avs.AvsManager manager) { + manager.maintenances().getWithResponse("group1", "cloud1", "maintenance1", com.azure.core.util.Context.NONE); + } +} +``` + +### Maintenances_InitiateChecks + +```java +/** + * Samples for Maintenances InitiateChecks. + */ +public final class MaintenancesInitiateChecksSamples { + /* + * x-ms-original-file: 2025-09-01/Maintenances_InitiateChecks.json + */ + /** + * Sample code: Maintenances_InitiateChecks. + * + * @param manager Entry point to AvsManager. + */ + public static void maintenancesInitiateChecks(com.azure.resourcemanager.avs.AvsManager manager) { + manager.maintenances() + .initiateChecksWithResponse("group1", "cloud1", "maintenance1", com.azure.core.util.Context.NONE); + } +} +``` + +### Maintenances_List + +```java + +/** + * Samples for Maintenances List. + */ +public final class MaintenancesListSamples { + /* + * x-ms-original-file: 2025-09-01/Maintenances_List.json + */ + /** + * Sample code: Maintenances_List. + * + * @param manager Entry point to AvsManager. + */ + public static void maintenancesList(com.azure.resourcemanager.avs.AvsManager manager) { + manager.maintenances().list("group1", "cloud1", null, null, null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Maintenances_Reschedule + +```java +import com.azure.resourcemanager.avs.models.MaintenanceReschedule; +import java.time.OffsetDateTime; + +/** + * Samples for Maintenances Reschedule. + */ +public final class MaintenancesRescheduleSamples { + /* + * x-ms-original-file: 2025-09-01/Maintenances_Reschedule.json + */ + /** + * Sample code: Maintenances_Reschedule. + * + * @param manager Entry point to AvsManager. + */ + public static void maintenancesReschedule(com.azure.resourcemanager.avs.AvsManager manager) { + manager.maintenances() + .rescheduleWithResponse("group1", "cloud1", "maintenance1", + new MaintenanceReschedule().withRescheduleTime(OffsetDateTime.parse("2023-01-12T16:17:55.237Z")) + .withMessage("Rescheduled due to xyz"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Maintenances_Schedule + +```java +import com.azure.resourcemanager.avs.models.MaintenanceSchedule; +import java.time.OffsetDateTime; + +/** + * Samples for Maintenances Schedule. + */ +public final class MaintenancesScheduleSamples { + /* + * x-ms-original-file: 2025-09-01/Maintenances_Schedule.json + */ + /** + * Sample code: Maintenances_Schedule. + * + * @param manager Entry point to AvsManager. + */ + public static void maintenancesSchedule(com.azure.resourcemanager.avs.AvsManager manager) { + manager.maintenances() + .scheduleWithResponse("group1", "cloud1", "maintenance1", + new MaintenanceSchedule().withScheduleTime(OffsetDateTime.parse("2025-09-12T16:17:55.237Z")) + .withMessage("scheduled due to xyz"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -1172,7 +1426,7 @@ public final class LocationsCheckTrialAvailabilitySamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: 2024-09-01/Operations_List.json + * x-ms-original-file: 2025-09-01/Operations_List.json */ /** * Sample code: Operations_List. @@ -1199,7 +1453,7 @@ import java.util.Arrays; */ public final class PlacementPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/PlacementPolicies_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/PlacementPolicies_CreateOrUpdate.json */ /** * Sample code: PlacementPolicies_CreateOrUpdate. @@ -1231,7 +1485,7 @@ public final class PlacementPoliciesCreateOrUpdateSamples { */ public final class PlacementPoliciesDeleteSamples { /* - * x-ms-original-file: 2024-09-01/PlacementPolicies_Delete.json + * x-ms-original-file: 2025-09-01/PlacementPolicies_Delete.json */ /** * Sample code: PlacementPolicies_Delete. @@ -1252,7 +1506,7 @@ public final class PlacementPoliciesDeleteSamples { */ public final class PlacementPoliciesGetSamples { /* - * x-ms-original-file: 2024-09-01/PlacementPolicies_Get.json + * x-ms-original-file: 2025-09-01/PlacementPolicies_Get.json */ /** * Sample code: PlacementPolicies_Get. @@ -1274,7 +1528,7 @@ public final class PlacementPoliciesGetSamples { */ public final class PlacementPoliciesListSamples { /* - * x-ms-original-file: 2024-09-01/PlacementPolicies_List.json + * x-ms-original-file: 2025-09-01/PlacementPolicies_List.json */ /** * Sample code: PlacementPolicies_List. @@ -1301,7 +1555,7 @@ import java.util.Arrays; */ public final class PlacementPoliciesUpdateSamples { /* - * x-ms-original-file: 2024-09-01/PlacementPolicies_Update.json + * x-ms-original-file: 2025-09-01/PlacementPolicies_Update.json */ /** * Sample code: PlacementPolicies_Update. @@ -1336,6 +1590,8 @@ import com.azure.resourcemanager.avs.models.ManagementCluster; import com.azure.resourcemanager.avs.models.PrivateCloudIdentity; import com.azure.resourcemanager.avs.models.ResourceIdentityType; import com.azure.resourcemanager.avs.models.Sku; +import com.azure.resourcemanager.avs.models.Vcf5License; +import java.time.OffsetDateTime; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -1345,7 +1601,7 @@ import java.util.Map; */ public final class PrivateCloudsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/PrivateClouds_CreateOrUpdate.json */ /** * Sample code: PrivateClouds_CreateOrUpdate. @@ -1362,11 +1618,16 @@ public final class PrivateCloudsCreateOrUpdateSamples { .withIdentity(new PrivateCloudIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withManagementCluster(new ManagementCluster().withClusterSize(4)) .withNetworkBlock("192.168.48.0/22") + .withVcfLicense(new Vcf5License().withLicenseKey("fakeTokenPlaceholder") + .withCores(16) + .withEndDate(OffsetDateTime.parse("2025-12-31T23:59:59Z")) + .withBroadcomSiteId("123456") + .withBroadcomContractNumber("123456")) .create(); } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_StretchedZones.json + * x-ms-original-file: 2025-09-01/PrivateClouds_CreateOrUpdate_StretchedZones.json */ /** * Sample code: PrivateClouds_CreateOrUpdate_StretchedZones. @@ -1383,11 +1644,16 @@ public final class PrivateCloudsCreateOrUpdateSamples { .withZones(Arrays.asList("1", "2")) .withManagementCluster(new ManagementCluster().withClusterSize(4)) .withNetworkBlock("192.168.48.0/22") + .withVcfLicense(new Vcf5License().withLicenseKey("fakeTokenPlaceholder") + .withCores(16) + .withEndDate(OffsetDateTime.parse("2025-12-31T23:59:59Z")) + .withBroadcomSiteId("123456") + .withBroadcomContractNumber("123456")) .create(); } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_FleetNative.json + * x-ms-original-file: 2025-09-01/PrivateClouds_CreateOrUpdate_FleetNative.json */ /** * Sample code: PrivateClouds_CreateOrUpdate_FleetNative. @@ -1406,11 +1672,16 @@ public final class PrivateCloudsCreateOrUpdateSamples { .withVirtualNetworkId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/vnet") .withDnsZoneType(DnsZoneType.PRIVATE) + .withVcfLicense(new Vcf5License().withLicenseKey("fakeTokenPlaceholder") + .withCores(16) + .withEndDate(OffsetDateTime.parse("2025-12-31T23:59:59Z")) + .withBroadcomSiteId("123456") + .withBroadcomContractNumber("123456")) .create(); } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_CreateOrUpdate_Stretched.json + * x-ms-original-file: 2025-09-01/PrivateClouds_CreateOrUpdate_Stretched.json */ /** * Sample code: PrivateClouds_CreateOrUpdate_Stretched. @@ -1429,6 +1700,11 @@ public final class PrivateCloudsCreateOrUpdateSamples { .withZone(1) .withSecondaryZone(2)) .withNetworkBlock("192.168.48.0/22") + .withVcfLicense(new Vcf5License().withLicenseKey("fakeTokenPlaceholder") + .withCores(16) + .withEndDate(OffsetDateTime.parse("2025-12-31T23:59:59Z")) + .withBroadcomSiteId("123456") + .withBroadcomContractNumber("123456")) .create(); } @@ -1454,7 +1730,7 @@ public final class PrivateCloudsCreateOrUpdateSamples { */ public final class PrivateCloudsDeleteSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_Delete.json + * x-ms-original-file: 2025-09-01/PrivateClouds_Delete.json */ /** * Sample code: PrivateClouds_Delete. @@ -1475,7 +1751,7 @@ public final class PrivateCloudsDeleteSamples { */ public final class PrivateCloudsGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_Get.json + * x-ms-original-file: 2025-09-01/PrivateClouds_Get.json */ /** * Sample code: PrivateClouds_Get. @@ -1487,7 +1763,7 @@ public final class PrivateCloudsGetByResourceGroupSamples { } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_Get_Stretched.json + * x-ms-original-file: 2025-09-01/PrivateClouds_Get_Stretched.json */ /** * Sample code: PrivateClouds_Get_Stretched. @@ -1500,6 +1776,27 @@ public final class PrivateCloudsGetByResourceGroupSamples { } ``` +### PrivateClouds_GetVcfLicense + +```java +/** + * Samples for PrivateClouds GetVcfLicense. + */ +public final class PrivateCloudsGetVcfLicenseSamples { + /* + * x-ms-original-file: 2025-09-01/PrivateClouds_GetVcfLicense.json + */ + /** + * Sample code: PrivateClouds_GetVcfLicense. + * + * @param manager Entry point to AvsManager. + */ + public static void privateCloudsGetVcfLicense(com.azure.resourcemanager.avs.AvsManager manager) { + manager.privateClouds().getVcfLicenseWithResponse("group1", "cloud1", com.azure.core.util.Context.NONE); + } +} +``` + ### PrivateClouds_List ```java @@ -1508,7 +1805,7 @@ public final class PrivateCloudsGetByResourceGroupSamples { */ public final class PrivateCloudsListSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_ListInSubscription.json + * x-ms-original-file: 2025-09-01/PrivateClouds_ListInSubscription.json */ /** * Sample code: PrivateClouds_ListInSubscription. @@ -1520,7 +1817,7 @@ public final class PrivateCloudsListSamples { } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_ListInSubscription_Stretched.json + * x-ms-original-file: 2025-09-01/PrivateClouds_ListInSubscription_Stretched.json */ /** * Sample code: PrivateClouds_ListInSubscription_Stretched. @@ -1541,7 +1838,7 @@ public final class PrivateCloudsListSamples { */ public final class PrivateCloudsListAdminCredentialsSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_ListAdminCredentials.json + * x-ms-original-file: 2025-09-01/PrivateClouds_ListAdminCredentials.json */ /** * Sample code: PrivateClouds_ListAdminCredentials. @@ -1562,7 +1859,7 @@ public final class PrivateCloudsListAdminCredentialsSamples { */ public final class PrivateCloudsListByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_List.json + * x-ms-original-file: 2025-09-01/PrivateClouds_List.json */ /** * Sample code: PrivateClouds_List. @@ -1574,7 +1871,7 @@ public final class PrivateCloudsListByResourceGroupSamples { } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_List_Stretched.json + * x-ms-original-file: 2025-09-01/PrivateClouds_List_Stretched.json */ /** * Sample code: PrivateClouds_List_Stretched. @@ -1595,7 +1892,7 @@ public final class PrivateCloudsListByResourceGroupSamples { */ public final class PrivateCloudsRotateNsxtPasswordSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_RotateNsxtPassword.json + * x-ms-original-file: 2025-09-01/PrivateClouds_RotateNsxtPassword.json */ /** * Sample code: PrivateClouds_RotateNsxtPassword. @@ -1616,7 +1913,7 @@ public final class PrivateCloudsRotateNsxtPasswordSamples { */ public final class PrivateCloudsRotateVcenterPasswordSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_RotateVcenterPassword.json + * x-ms-original-file: 2025-09-01/PrivateClouds_RotateVcenterPassword.json */ /** * Sample code: PrivateClouds_RotateVcenterPassword. @@ -1645,7 +1942,7 @@ import com.azure.resourcemanager.avs.models.ResourceIdentityType; */ public final class PrivateCloudsUpdateSamples { /* - * x-ms-original-file: 2024-09-01/PrivateClouds_Update.json + * x-ms-original-file: 2025-09-01/PrivateClouds_Update.json */ /** * Sample code: PrivateClouds_Update. @@ -1667,7 +1964,7 @@ public final class PrivateCloudsUpdateSamples { } /* - * x-ms-original-file: 2024-09-01/PrivateClouds_Update_Stretched.json + * x-ms-original-file: 2025-09-01/PrivateClouds_Update_Stretched.json */ /** * Sample code: PrivateClouds_Update_Stretched. @@ -1691,7 +1988,7 @@ public final class PrivateCloudsUpdateSamples { */ public final class ProvisionedNetworksGetSamples { /* - * x-ms-original-file: 2024-09-01/ProvisionedNetworks_Get.json + * x-ms-original-file: 2025-09-01/ProvisionedNetworks_Get.json */ /** * Sample code: ProvisionedNetworks_Get. @@ -1712,7 +2009,7 @@ public final class ProvisionedNetworksGetSamples { */ public final class ProvisionedNetworksListSamples { /* - * x-ms-original-file: 2024-09-01/ProvisionedNetworks_List.json + * x-ms-original-file: 2025-09-01/ProvisionedNetworks_List.json */ /** * Sample code: ProvisionedNetworks_List. @@ -1735,7 +2032,7 @@ import com.azure.resourcemanager.avs.models.PureStoragePolicyProperties; */ public final class PureStoragePoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/PureStoragePolicies_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/PureStoragePolicies_CreateOrUpdate.json */ /** * Sample code: PureStoragePolicies_CreateOrUpdate. @@ -1762,7 +2059,7 @@ public final class PureStoragePoliciesCreateOrUpdateSamples { */ public final class PureStoragePoliciesDeleteSamples { /* - * x-ms-original-file: 2024-09-01/PureStoragePolicies_Delete.json + * x-ms-original-file: 2025-09-01/PureStoragePolicies_Delete.json */ /** * Sample code: PureStoragePolicies_Delete. @@ -1783,7 +2080,7 @@ public final class PureStoragePoliciesDeleteSamples { */ public final class PureStoragePoliciesGetSamples { /* - * x-ms-original-file: 2024-09-01/PureStoragePolicies_Get.json + * x-ms-original-file: 2025-09-01/PureStoragePolicies_Get.json */ /** * Sample code: PureStoragePolicies_Get. @@ -1805,7 +2102,7 @@ public final class PureStoragePoliciesGetSamples { */ public final class PureStoragePoliciesListSamples { /* - * x-ms-original-file: 2024-09-01/PureStoragePolicies_List.json + * x-ms-original-file: 2025-09-01/PureStoragePolicies_List.json */ /** * Sample code: PureStoragePolicies_List. @@ -1826,7 +2123,7 @@ public final class PureStoragePoliciesListSamples { */ public final class ScriptCmdletsGetSamples { /* - * x-ms-original-file: 2024-09-01/ScriptCmdlets_Get.json + * x-ms-original-file: 2025-09-01/ScriptCmdlets_Get.json */ /** * Sample code: ScriptCmdlets_Get. @@ -1849,7 +2146,7 @@ public final class ScriptCmdletsGetSamples { */ public final class ScriptCmdletsListSamples { /* - * x-ms-original-file: 2024-09-01/ScriptCmdlets_List.json + * x-ms-original-file: 2025-09-01/ScriptCmdlets_List.json */ /** * Sample code: ScriptCmdlets_List. @@ -1874,7 +2171,7 @@ import java.util.Arrays; */ public final class ScriptExecutionsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-09-01/ScriptExecutions_CreateOrUpdate.json + * x-ms-original-file: 2025-09-01/ScriptExecutions_CreateOrUpdate.json */ /** * Sample code: ScriptExecutions_CreateOrUpdate. @@ -1908,7 +2205,7 @@ public final class ScriptExecutionsCreateOrUpdateSamples { */ public final class ScriptExecutionsDeleteSamples { /* - * x-ms-original-file: 2024-09-01/ScriptExecutions_Delete.json + * x-ms-original-file: 2025-09-01/ScriptExecutions_Delete.json */ /** * Sample code: ScriptExecutions_Delete. @@ -1929,7 +2226,7 @@ public final class ScriptExecutionsDeleteSamples { */ public final class ScriptExecutionsGetSamples { /* - * x-ms-original-file: 2024-09-01/ScriptExecutions_Get.json + * x-ms-original-file: 2025-09-01/ScriptExecutions_Get.json */ /** * Sample code: ScriptExecutions_Get. @@ -1954,7 +2251,7 @@ import java.util.Arrays; */ public final class ScriptExecutionsGetExecutionLogsSamples { /* - * x-ms-original-file: 2024-09-01/ScriptExecutions_GetExecutionLogs.json + * x-ms-original-file: 2025-09-01/ScriptExecutions_GetExecutionLogs.json */ /** * Sample code: ScriptExecutions_GetExecutionLogs. @@ -1979,7 +2276,7 @@ public final class ScriptExecutionsGetExecutionLogsSamples { */ public final class ScriptExecutionsListSamples { /* - * x-ms-original-file: 2024-09-01/ScriptExecutions_List.json + * x-ms-original-file: 2025-09-01/ScriptExecutions_List.json */ /** * Sample code: ScriptExecutions_List. @@ -2000,7 +2297,7 @@ public final class ScriptExecutionsListSamples { */ public final class ScriptPackagesGetSamples { /* - * x-ms-original-file: 2024-09-01/ScriptPackages_Get.json + * x-ms-original-file: 2025-09-01/ScriptPackages_Get.json */ /** * Sample code: ScriptPackages_Get. @@ -2022,7 +2319,7 @@ public final class ScriptPackagesGetSamples { */ public final class ScriptPackagesListSamples { /* - * x-ms-original-file: 2024-09-01/ScriptPackages_List.json + * x-ms-original-file: 2025-09-01/ScriptPackages_List.json */ /** * Sample code: ScriptPackages_List. @@ -2043,7 +2340,7 @@ public final class ScriptPackagesListSamples { */ public final class SkusListSamples { /* - * x-ms-original-file: 2024-09-01/Skus_List.json + * x-ms-original-file: 2025-09-01/Skus_List.json */ /** * Sample code: Skus_List. @@ -2064,7 +2361,7 @@ public final class SkusListSamples { */ public final class VirtualMachinesGetSamples { /* - * x-ms-original-file: 2024-09-01/VirtualMachines_Get.json + * x-ms-original-file: 2025-09-01/VirtualMachines_Get.json */ /** * Sample code: VirtualMachines_Get. @@ -2086,7 +2383,7 @@ public final class VirtualMachinesGetSamples { */ public final class VirtualMachinesListSamples { /* - * x-ms-original-file: 2024-09-01/VirtualMachines_List.json + * x-ms-original-file: 2025-09-01/VirtualMachines_List.json */ /** * Sample code: VirtualMachines_List. @@ -2110,7 +2407,7 @@ import com.azure.resourcemanager.avs.models.VirtualMachineRestrictMovementState; */ public final class VirtualMachinesRestrictMovementSamples { /* - * x-ms-original-file: 2024-09-01/VirtualMachines_RestrictMovement.json + * x-ms-original-file: 2025-09-01/VirtualMachines_RestrictMovement.json */ /** * Sample code: VirtualMachines_RestrictMovement. @@ -2136,7 +2433,7 @@ import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; */ public final class WorkloadNetworksCreateDhcpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDhcp.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreateDhcp.json */ /** * Sample code: WorkloadNetworks_CreateDhcp. @@ -2167,7 +2464,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksCreateDnsServiceSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDnsService.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreateDnsService.json */ /** * Sample code: WorkloadNetworks_CreateDnsService. @@ -2199,7 +2496,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksCreateDnsZoneSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateDnsZone.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreateDnsZone.json */ /** * Sample code: WorkloadNetworks_CreateDnsZone. @@ -2230,7 +2527,7 @@ import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; */ public final class WorkloadNetworksCreatePortMirroringSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreatePortMirroring.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreatePortMirroring.json */ /** * Sample code: WorkloadNetworks_CreatePortMirroring. @@ -2259,7 +2556,7 @@ public final class WorkloadNetworksCreatePortMirroringSamples { */ public final class WorkloadNetworksCreatePublicIpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreatePublicIP.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreatePublicIP.json */ /** * Sample code: WorkloadNetworks_CreatePublicIP. @@ -2288,7 +2585,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksCreateSegmentsSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateSegments.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreateSegments.json */ /** * Sample code: WorkloadNetworks_CreateSegments. @@ -2319,7 +2616,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksCreateVMGroupSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_CreateVMGroup.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_CreateVMGroup.json */ /** * Sample code: WorkloadNetworks_CreateVMGroup. @@ -2346,7 +2643,7 @@ public final class WorkloadNetworksCreateVMGroupSamples { */ public final class WorkloadNetworksDeleteDhcpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDhcp.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeleteDhcp.json */ /** * Sample code: WorkloadNetworks_DeleteDhcp. @@ -2367,7 +2664,7 @@ public final class WorkloadNetworksDeleteDhcpSamples { */ public final class WorkloadNetworksDeleteDnsServiceSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDnsService.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeleteDnsService.json */ /** * Sample code: WorkloadNetworks_DeleteDnsService. @@ -2389,7 +2686,7 @@ public final class WorkloadNetworksDeleteDnsServiceSamples { */ public final class WorkloadNetworksDeleteDnsZoneSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteDnsZone.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeleteDnsZone.json */ /** * Sample code: WorkloadNetworks_DeleteDnsZone. @@ -2410,7 +2707,7 @@ public final class WorkloadNetworksDeleteDnsZoneSamples { */ public final class WorkloadNetworksDeletePortMirroringSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeletePortMirroring.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeletePortMirroring.json */ /** * Sample code: WorkloadNetworks_DeletePortMirroring. @@ -2432,7 +2729,7 @@ public final class WorkloadNetworksDeletePortMirroringSamples { */ public final class WorkloadNetworksDeletePublicIpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeletePublicIP.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeletePublicIP.json */ /** * Sample code: WorkloadNetworks_DeletePublicIP. @@ -2453,7 +2750,7 @@ public final class WorkloadNetworksDeletePublicIpSamples { */ public final class WorkloadNetworksDeleteSegmentSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteSegment.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeleteSegment.json */ /** * Sample code: WorkloadNetworks_DeleteSegment. @@ -2474,7 +2771,7 @@ public final class WorkloadNetworksDeleteSegmentSamples { */ public final class WorkloadNetworksDeleteVMGroupSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_DeleteVMGroup.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_DeleteVMGroup.json */ /** * Sample code: WorkloadNetworks_DeleteVMGroup. @@ -2495,7 +2792,7 @@ public final class WorkloadNetworksDeleteVMGroupSamples { */ public final class WorkloadNetworksGetSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_Get.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_Get.json */ /** * Sample code: WorkloadNetworks_Get. @@ -2516,7 +2813,7 @@ public final class WorkloadNetworksGetSamples { */ public final class WorkloadNetworksGetDhcpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDhcp.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetDhcp.json */ /** * Sample code: WorkloadNetworks_GetDhcp. @@ -2537,7 +2834,7 @@ public final class WorkloadNetworksGetDhcpSamples { */ public final class WorkloadNetworksGetDnsServiceSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDnsService.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetDnsService.json */ /** * Sample code: WorkloadNetworks_GetDnsService. @@ -2559,7 +2856,7 @@ public final class WorkloadNetworksGetDnsServiceSamples { */ public final class WorkloadNetworksGetDnsZoneSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetDnsZone.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetDnsZone.json */ /** * Sample code: WorkloadNetworks_GetDnsZone. @@ -2581,7 +2878,7 @@ public final class WorkloadNetworksGetDnsZoneSamples { */ public final class WorkloadNetworksGetGatewaySamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetGateway.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetGateway.json */ /** * Sample code: WorkloadNetworks_GetGateway. @@ -2603,7 +2900,7 @@ public final class WorkloadNetworksGetGatewaySamples { */ public final class WorkloadNetworksGetPortMirroringSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetPortMirroring.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetPortMirroring.json */ /** * Sample code: WorkloadNetworks_GetPortMirroring. @@ -2625,7 +2922,7 @@ public final class WorkloadNetworksGetPortMirroringSamples { */ public final class WorkloadNetworksGetPublicIpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetPublicIP.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetPublicIP.json */ /** * Sample code: WorkloadNetworks_GetPublicIP. @@ -2647,7 +2944,7 @@ public final class WorkloadNetworksGetPublicIpSamples { */ public final class WorkloadNetworksGetSegmentSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetSegment.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetSegment.json */ /** * Sample code: WorkloadNetworks_GetSegment. @@ -2669,7 +2966,7 @@ public final class WorkloadNetworksGetSegmentSamples { */ public final class WorkloadNetworksGetVMGroupSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetVMGroup.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetVMGroup.json */ /** * Sample code: WorkloadNetworks_GetVMGroup. @@ -2691,7 +2988,7 @@ public final class WorkloadNetworksGetVMGroupSamples { */ public final class WorkloadNetworksGetVirtualMachineSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_GetVirtualMachine.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_GetVirtualMachine.json */ /** * Sample code: WorkloadNetworks_GetVirtualMachine. @@ -2713,7 +3010,7 @@ public final class WorkloadNetworksGetVirtualMachineSamples { */ public final class WorkloadNetworksListSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_List.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_List.json */ /** * Sample code: WorkloadNetworks_List. @@ -2734,7 +3031,7 @@ public final class WorkloadNetworksListSamples { */ public final class WorkloadNetworksListDhcpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDhcp.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListDhcp.json */ /** * Sample code: WorkloadNetworks_ListDhcp. @@ -2755,7 +3052,7 @@ public final class WorkloadNetworksListDhcpSamples { */ public final class WorkloadNetworksListDnsServicesSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDnsServices.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListDnsServices.json */ /** * Sample code: WorkloadNetworks_ListDnsServices. @@ -2776,7 +3073,7 @@ public final class WorkloadNetworksListDnsServicesSamples { */ public final class WorkloadNetworksListDnsZonesSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListDnsZones.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListDnsZones.json */ /** * Sample code: WorkloadNetworks_ListDnsZones. @@ -2797,7 +3094,7 @@ public final class WorkloadNetworksListDnsZonesSamples { */ public final class WorkloadNetworksListGatewaysSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListGateways.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListGateways.json */ /** * Sample code: WorkloadNetworks_ListGateways. @@ -2818,7 +3115,7 @@ public final class WorkloadNetworksListGatewaysSamples { */ public final class WorkloadNetworksListPortMirroringSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListPortMirroring.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListPortMirroring.json */ /** * Sample code: WorkloadNetworks_ListPortMirroring. @@ -2839,7 +3136,7 @@ public final class WorkloadNetworksListPortMirroringSamples { */ public final class WorkloadNetworksListPublicIPsSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListPublicIPs.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListPublicIPs.json */ /** * Sample code: WorkloadNetworks_ListPublicIPs. @@ -2860,7 +3157,7 @@ public final class WorkloadNetworksListPublicIPsSamples { */ public final class WorkloadNetworksListSegmentsSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListSegments.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListSegments.json */ /** * Sample code: WorkloadNetworks_ListSegments. @@ -2881,7 +3178,7 @@ public final class WorkloadNetworksListSegmentsSamples { */ public final class WorkloadNetworksListVMGroupsSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListVMGroups.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListVMGroups.json */ /** * Sample code: WorkloadNetworks_ListVMGroups. @@ -2902,7 +3199,7 @@ public final class WorkloadNetworksListVMGroupsSamples { */ public final class WorkloadNetworksListVirtualMachinesSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_ListVirtualMachines.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_ListVirtualMachines.json */ /** * Sample code: WorkloadNetworks_ListVirtualMachines. @@ -2926,7 +3223,7 @@ import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpServer; */ public final class WorkloadNetworksUpdateDhcpSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDhcp.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_UpdateDhcp.json */ /** * Sample code: WorkloadNetworks_UpdateDhcp. @@ -2957,7 +3254,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksUpdateDnsServiceSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDnsService.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_UpdateDnsService.json */ /** * Sample code: WorkloadNetworks_UpdateDnsService. @@ -2991,7 +3288,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksUpdateDnsZoneSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateDnsZone.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_UpdateDnsZone.json */ /** * Sample code: WorkloadNetworks_UpdateDnsZone. @@ -3024,7 +3321,7 @@ import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; */ public final class WorkloadNetworksUpdatePortMirroringSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdatePortMirroring.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_UpdatePortMirroring.json */ /** * Sample code: WorkloadNetworks_UpdatePortMirroring. @@ -3057,7 +3354,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksUpdateSegmentsSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateSegments.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_UpdateSegments.json */ /** * Sample code: WorkloadNetworks_UpdateSegments. @@ -3089,7 +3386,7 @@ import java.util.Arrays; */ public final class WorkloadNetworksUpdateVMGroupSamples { /* - * x-ms-original-file: 2024-09-01/WorkloadNetworks_UpdateVMGroup.json + * x-ms-original-file: 2025-09-01/WorkloadNetworks_UpdateVMGroup.json */ /** * Sample code: WorkloadNetworks_UpdateVMGroup. diff --git a/sdk/avs/azure-resourcemanager-avs/pom.xml b/sdk/avs/azure-resourcemanager-avs/pom.xml index 042363739ca8..cb6dd6b28b26 100644 --- a/sdk/avs/azure-resourcemanager-avs/pom.xml +++ b/sdk/avs/azure-resourcemanager-avs/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-avs - 1.4.0-beta.1 + 1.4.0 jar Microsoft Azure SDK for Avs Management - This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package api-version 2024-09-01. + This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package api-version 2025-09-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - true diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java index b54e622b6464..f014ebf508b7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java @@ -35,7 +35,9 @@ import com.azure.resourcemanager.avs.implementation.HcxEnterpriseSitesImpl; import com.azure.resourcemanager.avs.implementation.HostsImpl; import com.azure.resourcemanager.avs.implementation.IscsiPathsImpl; +import com.azure.resourcemanager.avs.implementation.LicensesImpl; import com.azure.resourcemanager.avs.implementation.LocationsImpl; +import com.azure.resourcemanager.avs.implementation.MaintenancesImpl; import com.azure.resourcemanager.avs.implementation.OperationsImpl; import com.azure.resourcemanager.avs.implementation.PlacementPoliciesImpl; import com.azure.resourcemanager.avs.implementation.PrivateCloudsImpl; @@ -56,7 +58,9 @@ import com.azure.resourcemanager.avs.models.HcxEnterpriseSites; import com.azure.resourcemanager.avs.models.Hosts; import com.azure.resourcemanager.avs.models.IscsiPaths; +import com.azure.resourcemanager.avs.models.Licenses; import com.azure.resourcemanager.avs.models.Locations; +import com.azure.resourcemanager.avs.models.Maintenances; import com.azure.resourcemanager.avs.models.Operations; import com.azure.resourcemanager.avs.models.PlacementPolicies; import com.azure.resourcemanager.avs.models.PrivateClouds; @@ -101,8 +105,12 @@ public final class AvsManager { private IscsiPaths iscsiPaths; + private Licenses licenses; + private Locations locations; + private Maintenances maintenances; + private PlacementPolicies placementPolicies; private PrivateClouds privateClouds; @@ -459,6 +467,18 @@ public IscsiPaths iscsiPaths() { return iscsiPaths; } + /** + * Gets the resource collection API of Licenses. It manages License. + * + * @return Resource collection API of Licenses. + */ + public Licenses licenses() { + if (this.licenses == null) { + this.licenses = new LicensesImpl(clientObject.getLicenses(), this); + } + return licenses; + } + /** * Gets the resource collection API of Locations. * @@ -471,6 +491,18 @@ public Locations locations() { return locations; } + /** + * Gets the resource collection API of Maintenances. + * + * @return Resource collection API of Maintenances. + */ + public Maintenances maintenances() { + if (this.maintenances == null) { + this.maintenances = new MaintenancesImpl(clientObject.getMaintenances(), this); + } + return maintenances; + } + /** * Gets the resource collection API of PlacementPolicies. It manages PlacementPolicy. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java index 1e2b56a6186b..17f7d194c805 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java @@ -116,6 +116,13 @@ public interface AvsClient { */ IscsiPathsClient getIscsiPaths(); + /** + * Gets the LicensesClient object to access its operations. + * + * @return the LicensesClient object. + */ + LicensesClient getLicenses(); + /** * Gets the LocationsClient object to access its operations. * @@ -123,6 +130,13 @@ public interface AvsClient { */ LocationsClient getLocations(); + /** + * Gets the MaintenancesClient object to access its operations. + * + * @return the MaintenancesClient object. + */ + MaintenancesClient getMaintenances(); + /** * Gets the PlacementPoliciesClient object to access its operations. * diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LicensesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LicensesClient.java new file mode 100644 index 000000000000..b935976181bf --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LicensesClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.models.LicenseInner; +import com.azure.resourcemanager.avs.fluent.models.LicensePropertiesInner; +import com.azure.resourcemanager.avs.models.LicenseName; + +/** + * An instance of this class provides access to all the operations defined in LicensesClient. + */ +public interface LicensesClient { + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of a License list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a License list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @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 License along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String privateCloudName, LicenseName licenseName, + Context context); + + /** + * Get a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 License. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner get(String resourceGroupName, String privateCloudName, LicenseName licenseName); + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 {@link SyncPoller} for polling of a license resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginCreateOrUpdate(String resourceGroupName, + String privateCloudName, LicenseName licenseName, LicenseInner resource); + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 {@link SyncPoller} for polling of a license resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LicenseInner> beginCreateOrUpdate(String resourceGroupName, + String privateCloudName, LicenseName licenseName, LicenseInner resource, Context context); + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner createOrUpdate(String resourceGroupName, String privateCloudName, LicenseName licenseName, + LicenseInner resource); + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicenseInner createOrUpdate(String resourceGroupName, String privateCloudName, LicenseName licenseName, + LicenseInner resource, Context context); + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 privateCloudName, + LicenseName licenseName); + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @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 privateCloudName, + LicenseName licenseName, Context context); + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, LicenseName licenseName); + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @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 privateCloudName, LicenseName licenseName, Context context); + + /** + * Just like ArmResourceActionSync, but with no request body. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @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 a license along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPropertiesWithResponse(String resourceGroupName, String privateCloudName, + LicenseName licenseName, Context context); + + /** + * Just like ArmResourceActionSync, but with no request body. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a license. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LicensePropertiesInner getProperties(String resourceGroupName, String privateCloudName, LicenseName licenseName); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/MaintenancesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/MaintenancesClient.java new file mode 100644 index 000000000000..b50d464b59ba --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/MaintenancesClient.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.util.Context; +import com.azure.resourcemanager.avs.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.avs.models.MaintenanceReschedule; +import com.azure.resourcemanager.avs.models.MaintenanceSchedule; +import com.azure.resourcemanager.avs.models.MaintenanceStateName; +import com.azure.resourcemanager.avs.models.MaintenanceStatusFilter; +import java.time.OffsetDateTime; + +/** + * An instance of this class provides access to all the operations defined in MaintenancesClient. + */ +public interface MaintenancesClient { + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param stateName Filter maintenances based on state. + * @param status Filter active or inactive maintenances. + * @param from date from which result should be returned. ie. scheduledStartTime >= from. + * @param to date till which result should be returned. i.e. scheduledStartTime <= to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to, + Context context); + + /** + * Get a Maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @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 Maintenance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, Context context); + + /** + * Get a Maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner get(String resourceGroupName, String privateCloudName, String maintenanceName); + + /** + * Reschedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response rescheduleWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceReschedule body, Context context); + + /** + * Reschedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action 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 a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner reschedule(String resourceGroupName, String privateCloudName, String maintenanceName, + MaintenanceReschedule body); + + /** + * Schedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response scheduleWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceSchedule body, Context context); + + /** + * Schedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action 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 a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner schedule(String resourceGroupName, String privateCloudName, String maintenanceName, + MaintenanceSchedule body); + + /** + * Initiate maintenance readiness checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @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 cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response initiateChecksWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, Context context); + + /** + * Initiate maintenance readiness checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceInner initiateChecks(String resourceGroupName, String privateCloudName, String maintenanceName); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java index dfcb28233ee6..675f2e7cf5f5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java @@ -13,6 +13,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.fluent.models.VcfLicenseInner; import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; /** @@ -401,4 +402,32 @@ Response listAdminCredentialsWithResponse(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName); + + /** + * Get the license for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @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 license for the private cloud along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVcfLicenseWithResponse(String resourceGroupName, String privateCloudName, + Context context); + + /** + * Get the license for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the license for the private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VcfLicenseInner getVcfLicense(String resourceGroupName, String privateCloudName); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java index 74781b8b0826..b10182fc28ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java @@ -108,6 +108,17 @@ public String id() { return this.id; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java index 1a0a8942d7cf..900df918e115 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java @@ -78,6 +78,14 @@ public String vcenterPassword() { return this.vcenterPassword; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java index be2fb5a1d383..0e017ae37ee6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkInner.java @@ -139,6 +139,17 @@ public CloudLinkInner withLinkedCloud(String linkedCloud) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java index 1255888ad89b..b57cce1d3d57 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/CloudLinkProperties.java @@ -77,6 +77,14 @@ public CloudLinkProperties withLinkedCloud(String linkedCloud) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java index df97b08ed62d..1c7054106756 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -211,6 +212,25 @@ public ClusterInner withVsanDatastoreName(String vsanDatastoreName) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model ClusterInner")); + } else { + sku().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterInner.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java index 27df4ba32c77..8131d8adcc2b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterProperties.java @@ -127,6 +127,14 @@ public ClusterProperties withVsanDatastoreName(String vsanDatastoreName) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java index f083830a15a6..00e55c4b7689 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterUpdateProperties.java @@ -73,6 +73,14 @@ public ClusterUpdateProperties withHosts(List hosts) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java index 46bfb9037fbb..0177b66e5d7e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterZoneListInner.java @@ -38,6 +38,17 @@ public List zones() { return this.zones; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zones() != null) { + zones().forEach(e -> e.validate()); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java index f142ecef48f0..a7017e380ab9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java @@ -212,6 +212,17 @@ public DatastoreStatus status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java index b887daec70ab..5ef80578aae0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreProperties.java @@ -156,6 +156,26 @@ public DatastoreStatus status() { return this.status; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (netAppVolume() != null) { + netAppVolume().validate(); + } + if (diskPoolVolume() != null) { + diskPoolVolume().validate(); + } + if (elasticSanVolume() != null) { + elasticSanVolume().validate(); + } + if (pureStorageVolume() != null) { + pureStorageVolume().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java index 0a0f71d3ef78..0bd4d8fd831c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java @@ -147,6 +147,17 @@ public ExpressRouteAuthorizationInner withExpressRouteId(String expressRouteId) return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java index e2716dcb9bb5..0264950dcd01 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationProperties.java @@ -91,6 +91,14 @@ public ExpressRouteAuthorizationProperties withExpressRouteId(String expressRout return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java index 11331d758b2e..bb9dd9b570e4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java @@ -201,6 +201,17 @@ public GlobalReachConnectionInner withExpressRouteId(String expressRouteId) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java index 9574ecdd9d1c..3d759a9817d2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionProperties.java @@ -152,6 +152,14 @@ public GlobalReachConnectionProperties withExpressRouteId(String expressRouteId) return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java index 606ac851f931..983e7a7570c0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java @@ -125,6 +125,17 @@ public HcxEnterpriseSiteStatus status() { return this.innerProperties() == null ? null : this.innerProperties().status(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java index 1060670576a7..94feae234d74 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteProperties.java @@ -66,6 +66,14 @@ public HcxEnterpriseSiteStatus status() { return this.status; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java index e1a3b87b144a..7e96f5239b12 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HostModelInner.java @@ -127,6 +127,20 @@ public String id() { return this.id; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java index dc793c1d5f2e..2f1c23cd338f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathInner.java @@ -129,6 +129,17 @@ public IscsiPathInner withNetworkBlock(String networkBlock) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java index 0743fc6e723f..5f333c4f4f36 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/IscsiPathProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.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; @@ -62,6 +63,21 @@ public IscsiPathProperties withNetworkBlock(String networkBlock) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkBlock() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkBlock in model IscsiPathProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IscsiPathProperties.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/LicenseInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/LicenseInner.java new file mode 100644 index 000000000000..e2c6d623577e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/LicenseInner.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.avs.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 java.io.IOException; + +/** + * A license resource. + */ +@Fluent +public final class LicenseInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private LicensePropertiesInner properties; + + /* + * 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 LicenseInner class. + */ + public LicenseInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LicensePropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LicenseInner object itself. + */ + public LicenseInner withProperties(LicensePropertiesInner properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LicenseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LicenseInner 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 LicenseInner. + */ + public static LicenseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LicenseInner deserializedLicenseInner = new LicenseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLicenseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLicenseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLicenseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLicenseInner.properties = LicensePropertiesInner.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLicenseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLicenseInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/LicensePropertiesInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/LicensePropertiesInner.java new file mode 100644 index 000000000000..0c49808259a9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/LicensePropertiesInner.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.avs.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.avs.models.LicenseKind; +import com.azure.resourcemanager.avs.models.LicenseProvisioningState; +import com.azure.resourcemanager.avs.models.VmwareFirewallLicenseProperties; +import java.io.IOException; + +/** + * The properties of a license. + */ +@Immutable +public class LicensePropertiesInner implements JsonSerializable { + /* + * License kind + */ + private LicenseKind kind = LicenseKind.fromString("LicenseProperties"); + + /* + * The state of the license provisioning + */ + private LicenseProvisioningState provisioningState; + + /** + * Creates an instance of LicensePropertiesInner class. + */ + public LicensePropertiesInner() { + } + + /** + * Get the kind property: License kind. + * + * @return the kind value. + */ + public LicenseKind kind() { + return this.kind; + } + + /** + * Get the provisioningState property: The state of the license provisioning. + * + * @return the provisioningState value. + */ + public LicenseProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The state of the license provisioning. + * + * @param provisioningState the provisioningState value to set. + * @return the LicensePropertiesInner object itself. + */ + LicensePropertiesInner withProvisioningState(LicenseProvisioningState provisioningState) { + this.provisioningState = provisioningState; + 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("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LicensePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LicensePropertiesInner 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 LicensePropertiesInner. + */ + public static LicensePropertiesInner 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 ("VmwareFirewall".equals(discriminatorValue)) { + return VmwareFirewallLicenseProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static LicensePropertiesInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LicensePropertiesInner deserializedLicensePropertiesInner = new LicensePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedLicensePropertiesInner.kind = LicenseKind.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedLicensePropertiesInner.provisioningState + = LicenseProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLicensePropertiesInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/MaintenanceInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/MaintenanceInner.java new file mode 100644 index 000000000000..36f2e59c0dc8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/MaintenanceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.avs.models.MaintenanceProperties; +import java.io.IOException; + +/** + * A cluster resource. + */ +@Immutable +public final class MaintenanceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private MaintenanceProperties properties; + + /* + * 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 MaintenanceInner class. + */ + private MaintenanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public MaintenanceProperties properties() { + return this.properties; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaintenanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceInner 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 MaintenanceInner. + */ + public static MaintenanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceInner deserializedMaintenanceInner = new MaintenanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMaintenanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMaintenanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMaintenanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMaintenanceInner.properties = MaintenanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMaintenanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java index 739a16f91701..73d77a663a34 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java @@ -104,6 +104,17 @@ public ActionType actionType() { return this.actionType; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java index 7350f4311b0d..39f303d8b7a5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyInner.java @@ -108,6 +108,17 @@ public String id() { return this.id; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java index 49d20a419054..9e5937d64077 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PlacementPolicyUpdateProperties.java @@ -151,6 +151,14 @@ public PlacementPolicyUpdateProperties withAzureHybridBenefitType(AzureHybridBen return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java index 4811027999d4..23bedcc2ec01 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -34,7 +35,7 @@ public final class PrivateCloudInner extends Resource { /* * The resource-specific properties for this resource. */ - private PrivateCloudProperties innerProperties; + private PrivateCloudPropertiesInner innerProperties; /* * The SKU (Stock Keeping Unit) assigned to this resource. @@ -82,7 +83,7 @@ public PrivateCloudInner() { * * @return the innerProperties value. */ - private PrivateCloudProperties innerProperties() { + private PrivateCloudPropertiesInner innerProperties() { return this.innerProperties; } @@ -220,7 +221,7 @@ public ManagementCluster managementCluster() { */ public PrivateCloudInner withManagementCluster(ManagementCluster managementCluster) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withManagementCluster(managementCluster); return this; @@ -243,7 +244,7 @@ public InternetEnum internet() { */ public PrivateCloudInner withInternet(InternetEnum internet) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withInternet(internet); return this; @@ -266,7 +267,7 @@ public List identitySources() { */ public PrivateCloudInner withIdentitySources(List identitySources) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withIdentitySources(identitySources); return this; @@ -289,7 +290,7 @@ public AvailabilityProperties availability() { */ public PrivateCloudInner withAvailability(AvailabilityProperties availability) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withAvailability(availability); return this; @@ -312,7 +313,7 @@ public Encryption encryption() { */ public PrivateCloudInner withEncryption(Encryption encryption) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withEncryption(encryption); return this; @@ -343,7 +344,7 @@ public List extendedNetworkBlocks() { */ public PrivateCloudInner withExtendedNetworkBlocks(List extendedNetworkBlocks) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withExtendedNetworkBlocks(extendedNetworkBlocks); return this; @@ -375,7 +376,7 @@ public Circuit circuit() { */ public PrivateCloudInner withCircuit(Circuit circuit) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withCircuit(circuit); return this; @@ -411,7 +412,7 @@ public String networkBlock() { */ public PrivateCloudInner withNetworkBlock(String networkBlock) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withNetworkBlock(networkBlock); return this; @@ -461,7 +462,7 @@ public String vcenterPassword() { */ public PrivateCloudInner withVcenterPassword(String vcenterPassword) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withVcenterPassword(vcenterPassword); return this; @@ -484,7 +485,7 @@ public String nsxtPassword() { */ public PrivateCloudInner withNsxtPassword(String nsxtPassword) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withNsxtPassword(nsxtPassword); return this; @@ -536,7 +537,7 @@ public Circuit secondaryCircuit() { */ public PrivateCloudInner withSecondaryCircuit(Circuit secondaryCircuit) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withSecondaryCircuit(secondaryCircuit); return this; @@ -570,7 +571,7 @@ public String virtualNetworkId() { */ public PrivateCloudInner withVirtualNetworkId(String virtualNetworkId) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withVirtualNetworkId(virtualNetworkId); return this; @@ -593,12 +594,57 @@ public DnsZoneType dnsZoneType() { */ public PrivateCloudInner withDnsZoneType(DnsZoneType dnsZoneType) { if (this.innerProperties() == null) { - this.innerProperties = new PrivateCloudProperties(); + this.innerProperties = new PrivateCloudPropertiesInner(); } this.innerProperties().withDnsZoneType(dnsZoneType); return this; } + /** + * Get the vcfLicense property: The private cloud license. + * + * @return the vcfLicense value. + */ + public VcfLicenseInner vcfLicense() { + return this.innerProperties() == null ? null : this.innerProperties().vcfLicense(); + } + + /** + * Set the vcfLicense property: The private cloud license. + * + * @param vcfLicense the vcfLicense value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVcfLicense(VcfLicenseInner vcfLicense) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateCloudPropertiesInner(); + } + this.innerProperties().withVcfLicense(vcfLicense); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model PrivateCloudInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudInner.class); + /** * {@inheritDoc} */ @@ -644,7 +690,7 @@ public static PrivateCloudInner fromJson(JsonReader jsonReader) throws IOExcepti } else if ("sku".equals(fieldName)) { deserializedPrivateCloudInner.sku = Sku.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedPrivateCloudInner.innerProperties = PrivateCloudProperties.fromJson(reader); + deserializedPrivateCloudInner.innerProperties = PrivateCloudPropertiesInner.fromJson(reader); } else if ("identity".equals(fieldName)) { deserializedPrivateCloudInner.identity = PrivateCloudIdentity.fromJson(reader); } else if ("zones".equals(fieldName)) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudPropertiesInner.java similarity index 70% rename from sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudProperties.java rename to sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudPropertiesInner.java index c640750b6654..c86f7de6a0b3 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudPropertiesInner.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.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; @@ -26,7 +27,7 @@ * The properties of a private cloud resource. */ @Fluent -public final class PrivateCloudProperties implements JsonSerializable { +public final class PrivateCloudPropertiesInner implements JsonSerializable { /* * The default cluster used for management */ @@ -144,10 +145,15 @@ public final class PrivateCloudProperties implements JsonSerializable identitySources() { * Set the identitySources property: vCenter Single Sign On Identity Sources. * * @param identitySources the identitySources value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withIdentitySources(List identitySources) { + public PrivateCloudPropertiesInner withIdentitySources(List identitySources) { this.identitySources = identitySources; return this; } @@ -223,9 +229,9 @@ public AvailabilityProperties availability() { * Set the availability property: Properties describing how the cloud is distributed across availability zones. * * @param availability the availability value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withAvailability(AvailabilityProperties availability) { + public PrivateCloudPropertiesInner withAvailability(AvailabilityProperties availability) { this.availability = availability; return this; } @@ -243,9 +249,9 @@ public Encryption encryption() { * Set the encryption property: Customer managed key encryption, can be enabled or disabled. * * @param encryption the encryption value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withEncryption(Encryption encryption) { + public PrivateCloudPropertiesInner withEncryption(Encryption encryption) { this.encryption = encryption; return this; } @@ -271,9 +277,9 @@ public List extendedNetworkBlocks() { * (A.B.C.D/X). * * @param extendedNetworkBlocks the extendedNetworkBlocks value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withExtendedNetworkBlocks(List extendedNetworkBlocks) { + public PrivateCloudPropertiesInner withExtendedNetworkBlocks(List extendedNetworkBlocks) { this.extendedNetworkBlocks = extendedNetworkBlocks; return this; } @@ -300,9 +306,9 @@ public Circuit circuit() { * Set the circuit property: An ExpressRoute Circuit. * * @param circuit the circuit value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withCircuit(Circuit circuit) { + public PrivateCloudPropertiesInner withCircuit(Circuit circuit) { this.circuit = circuit; return this; } @@ -333,9 +339,9 @@ public String networkBlock() { * A,B,C,D are between 0 and 255, and X is between 0 and 22. * * @param networkBlock the networkBlock value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withNetworkBlock(String networkBlock) { + public PrivateCloudPropertiesInner withNetworkBlock(String networkBlock) { this.networkBlock = networkBlock; return this; } @@ -380,9 +386,9 @@ public String vcenterPassword() { * Set the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. * * @param vcenterPassword the vcenterPassword value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withVcenterPassword(String vcenterPassword) { + public PrivateCloudPropertiesInner withVcenterPassword(String vcenterPassword) { this.vcenterPassword = vcenterPassword; return this; } @@ -400,9 +406,9 @@ public String nsxtPassword() { * Set the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. * * @param nsxtPassword the nsxtPassword value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withNsxtPassword(String nsxtPassword) { + public PrivateCloudPropertiesInner withNsxtPassword(String nsxtPassword) { this.nsxtPassword = nsxtPassword; return this; } @@ -449,9 +455,9 @@ public Circuit secondaryCircuit() { * stretched private cloud. * * @param secondaryCircuit the secondaryCircuit value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withSecondaryCircuit(Circuit secondaryCircuit) { + public PrivateCloudPropertiesInner withSecondaryCircuit(Circuit secondaryCircuit) { this.secondaryCircuit = secondaryCircuit; return this; } @@ -480,9 +486,9 @@ public String virtualNetworkId() { * Set the virtualNetworkId property: Azure resource ID of the virtual network. * * @param virtualNetworkId the virtualNetworkId value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withVirtualNetworkId(String virtualNetworkId) { + public PrivateCloudPropertiesInner withVirtualNetworkId(String virtualNetworkId) { this.virtualNetworkId = virtualNetworkId; return this; } @@ -500,13 +506,76 @@ public DnsZoneType dnsZoneType() { * Set the dnsZoneType property: The type of DNS zone to use. * * @param dnsZoneType the dnsZoneType value to set. - * @return the PrivateCloudProperties object itself. + * @return the PrivateCloudPropertiesInner object itself. */ - public PrivateCloudProperties withDnsZoneType(DnsZoneType dnsZoneType) { + public PrivateCloudPropertiesInner withDnsZoneType(DnsZoneType dnsZoneType) { this.dnsZoneType = dnsZoneType; return this; } + /** + * Get the vcfLicense property: The private cloud license. + * + * @return the vcfLicense value. + */ + public VcfLicenseInner vcfLicense() { + return this.vcfLicense; + } + + /** + * Set the vcfLicense property: The private cloud license. + * + * @param vcfLicense the vcfLicense value to set. + * @return the PrivateCloudPropertiesInner object itself. + */ + public PrivateCloudPropertiesInner withVcfLicense(VcfLicenseInner vcfLicense) { + this.vcfLicense = vcfLicense; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementCluster() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property managementCluster in model PrivateCloudPropertiesInner")); + } else { + managementCluster().validate(); + } + if (identitySources() != null) { + identitySources().forEach(e -> e.validate()); + } + if (availability() != null) { + availability().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (circuit() != null) { + circuit().validate(); + } + if (endpoints() != null) { + endpoints().validate(); + } + if (networkBlock() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkBlock in model PrivateCloudPropertiesInner")); + } + if (secondaryCircuit() != null) { + secondaryCircuit().validate(); + } + if (vcfLicense() != null) { + vcfLicense().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudPropertiesInner.class); + /** * {@inheritDoc} */ @@ -528,81 +597,84 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("secondaryCircuit", this.secondaryCircuit); jsonWriter.writeStringField("virtualNetworkId", this.virtualNetworkId); jsonWriter.writeStringField("dnsZoneType", this.dnsZoneType == null ? null : this.dnsZoneType.toString()); + jsonWriter.writeJsonField("vcfLicense", this.vcfLicense); return jsonWriter.writeEndObject(); } /** - * Reads an instance of PrivateCloudProperties from the JsonReader. + * Reads an instance of PrivateCloudPropertiesInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of PrivateCloudProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of PrivateCloudPropertiesInner 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 PrivateCloudProperties. + * @throws IOException If an error occurs while reading the PrivateCloudPropertiesInner. */ - public static PrivateCloudProperties fromJson(JsonReader jsonReader) throws IOException { + public static PrivateCloudPropertiesInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - PrivateCloudProperties deserializedPrivateCloudProperties = new PrivateCloudProperties(); + PrivateCloudPropertiesInner deserializedPrivateCloudPropertiesInner = new PrivateCloudPropertiesInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("managementCluster".equals(fieldName)) { - deserializedPrivateCloudProperties.managementCluster = ManagementCluster.fromJson(reader); + deserializedPrivateCloudPropertiesInner.managementCluster = ManagementCluster.fromJson(reader); } else if ("networkBlock".equals(fieldName)) { - deserializedPrivateCloudProperties.networkBlock = reader.getString(); + deserializedPrivateCloudPropertiesInner.networkBlock = reader.getString(); } else if ("internet".equals(fieldName)) { - deserializedPrivateCloudProperties.internet = InternetEnum.fromString(reader.getString()); + deserializedPrivateCloudPropertiesInner.internet = InternetEnum.fromString(reader.getString()); } else if ("identitySources".equals(fieldName)) { List identitySources = reader.readArray(reader1 -> IdentitySource.fromJson(reader1)); - deserializedPrivateCloudProperties.identitySources = identitySources; + deserializedPrivateCloudPropertiesInner.identitySources = identitySources; } else if ("availability".equals(fieldName)) { - deserializedPrivateCloudProperties.availability = AvailabilityProperties.fromJson(reader); + deserializedPrivateCloudPropertiesInner.availability = AvailabilityProperties.fromJson(reader); } else if ("encryption".equals(fieldName)) { - deserializedPrivateCloudProperties.encryption = Encryption.fromJson(reader); + deserializedPrivateCloudPropertiesInner.encryption = Encryption.fromJson(reader); } else if ("extendedNetworkBlocks".equals(fieldName)) { List extendedNetworkBlocks = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateCloudProperties.extendedNetworkBlocks = extendedNetworkBlocks; + deserializedPrivateCloudPropertiesInner.extendedNetworkBlocks = extendedNetworkBlocks; } else if ("provisioningState".equals(fieldName)) { - deserializedPrivateCloudProperties.provisioningState + deserializedPrivateCloudPropertiesInner.provisioningState = PrivateCloudProvisioningState.fromString(reader.getString()); } else if ("circuit".equals(fieldName)) { - deserializedPrivateCloudProperties.circuit = Circuit.fromJson(reader); + deserializedPrivateCloudPropertiesInner.circuit = Circuit.fromJson(reader); } else if ("endpoints".equals(fieldName)) { - deserializedPrivateCloudProperties.endpoints = Endpoints.fromJson(reader); + deserializedPrivateCloudPropertiesInner.endpoints = Endpoints.fromJson(reader); } else if ("managementNetwork".equals(fieldName)) { - deserializedPrivateCloudProperties.managementNetwork = reader.getString(); + deserializedPrivateCloudPropertiesInner.managementNetwork = reader.getString(); } else if ("provisioningNetwork".equals(fieldName)) { - deserializedPrivateCloudProperties.provisioningNetwork = reader.getString(); + deserializedPrivateCloudPropertiesInner.provisioningNetwork = reader.getString(); } else if ("vmotionNetwork".equals(fieldName)) { - deserializedPrivateCloudProperties.vmotionNetwork = reader.getString(); + deserializedPrivateCloudPropertiesInner.vmotionNetwork = reader.getString(); } else if ("vcenterPassword".equals(fieldName)) { - deserializedPrivateCloudProperties.vcenterPassword = reader.getString(); + deserializedPrivateCloudPropertiesInner.vcenterPassword = reader.getString(); } else if ("nsxtPassword".equals(fieldName)) { - deserializedPrivateCloudProperties.nsxtPassword = reader.getString(); + deserializedPrivateCloudPropertiesInner.nsxtPassword = reader.getString(); } else if ("vcenterCertificateThumbprint".equals(fieldName)) { - deserializedPrivateCloudProperties.vcenterCertificateThumbprint = reader.getString(); + deserializedPrivateCloudPropertiesInner.vcenterCertificateThumbprint = reader.getString(); } else if ("nsxtCertificateThumbprint".equals(fieldName)) { - deserializedPrivateCloudProperties.nsxtCertificateThumbprint = reader.getString(); + deserializedPrivateCloudPropertiesInner.nsxtCertificateThumbprint = reader.getString(); } else if ("externalCloudLinks".equals(fieldName)) { List externalCloudLinks = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateCloudProperties.externalCloudLinks = externalCloudLinks; + deserializedPrivateCloudPropertiesInner.externalCloudLinks = externalCloudLinks; } else if ("secondaryCircuit".equals(fieldName)) { - deserializedPrivateCloudProperties.secondaryCircuit = Circuit.fromJson(reader); + deserializedPrivateCloudPropertiesInner.secondaryCircuit = Circuit.fromJson(reader); } else if ("nsxPublicIpQuotaRaised".equals(fieldName)) { - deserializedPrivateCloudProperties.nsxPublicIpQuotaRaised + deserializedPrivateCloudPropertiesInner.nsxPublicIpQuotaRaised = NsxPublicIpQuotaRaisedEnum.fromString(reader.getString()); } else if ("virtualNetworkId".equals(fieldName)) { - deserializedPrivateCloudProperties.virtualNetworkId = reader.getString(); + deserializedPrivateCloudPropertiesInner.virtualNetworkId = reader.getString(); } else if ("dnsZoneType".equals(fieldName)) { - deserializedPrivateCloudProperties.dnsZoneType = DnsZoneType.fromString(reader.getString()); + deserializedPrivateCloudPropertiesInner.dnsZoneType = DnsZoneType.fromString(reader.getString()); + } else if ("vcfLicense".equals(fieldName)) { + deserializedPrivateCloudPropertiesInner.vcfLicense = VcfLicenseInner.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedPrivateCloudProperties; + return deserializedPrivateCloudPropertiesInner; }); } } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java index 7ec3d032a177..da1d4d2bbdbe 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudUpdateProperties.java @@ -215,6 +215,26 @@ public PrivateCloudUpdateProperties withDnsZoneType(DnsZoneType dnsZoneType) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementCluster() != null) { + managementCluster().validate(); + } + if (identitySources() != null) { + identitySources().forEach(e -> e.validate()); + } + if (availability() != null) { + availability().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java index e58df3ea5225..1877d7e8d82d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ProvisionedNetworkInner.java @@ -97,6 +97,17 @@ public String id() { return this.id; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PureStoragePolicyInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PureStoragePolicyInner.java index 6b584815c84f..df6cde2e5e59 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PureStoragePolicyInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PureStoragePolicyInner.java @@ -108,6 +108,17 @@ public String id() { return this.id; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java index 067fee79ab6f..3cb22332a58a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java @@ -52,6 +52,14 @@ public QuotaEnabled quotaEnabled() { return this.quotaEnabled; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java index ece947e0bb91..78f24a16321e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ResourceSkuInner.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -154,6 +155,43 @@ public List restrictions() { return this.restrictions; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property resourceType in model ResourceSkuInner")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ResourceSkuInner")); + } + if (locations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property locations in model ResourceSkuInner")); + } + if (locationInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property locationInfo in model ResourceSkuInner")); + } else { + locationInfo().forEach(e -> e.validate()); + } + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + if (restrictions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property restrictions in model ResourceSkuInner")); + } else { + restrictions().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuInner.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java index d1e200f60f17..dfa4dcbf8866 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletInner.java @@ -146,6 +146,17 @@ public List parameters() { return this.innerProperties() == null ? null : this.innerProperties().parameters(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java index 46ac56c3f1f1..64f1e523c7f6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptCmdletProperties.java @@ -97,6 +97,17 @@ public List parameters() { return this.parameters; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java index e1a4317b5f4a..bb812745872f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionInner.java @@ -352,6 +352,17 @@ public List errors() { return this.innerProperties() == null ? null : this.innerProperties().errors(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java index 79cf2900dcc2..161f8ead51bd 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptExecutionProperties.java @@ -6,6 +6,7 @@ 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; @@ -332,6 +333,27 @@ public List errors() { return this.errors; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + if (hiddenParameters() != null) { + hiddenParameters().forEach(e -> e.validate()); + } + if (timeout() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timeout in model ScriptExecutionProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptExecutionProperties.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java index 8533bc745477..8c28fd56d560 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageInner.java @@ -142,6 +142,17 @@ public String uri() { return this.innerProperties() == null ? null : this.innerProperties().uri(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java index 4767e9112643..2102134fa1d9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ScriptPackageProperties.java @@ -93,6 +93,14 @@ public String uri() { return this.uri; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java index ba815e2b565e..82c6e9f8cd52 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java @@ -51,6 +51,14 @@ public Integer availableHosts() { return this.availableHosts; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VcfLicenseInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VcfLicenseInner.java new file mode 100644 index 000000000000..42d85974fe3d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VcfLicenseInner.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.avs.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.avs.models.LicenseProvisioningState; +import com.azure.resourcemanager.avs.models.Vcf5License; +import com.azure.resourcemanager.avs.models.VcfLicenseKind; +import java.io.IOException; + +/** + * A VMware Cloud Foundation license. + */ +@Immutable +public class VcfLicenseInner implements JsonSerializable { + /* + * License kind + */ + private VcfLicenseKind kind = VcfLicenseKind.fromString("VcfLicense"); + + /* + * The state of the license provisioning + */ + private LicenseProvisioningState provisioningState; + + /** + * Creates an instance of VcfLicenseInner class. + */ + public VcfLicenseInner() { + } + + /** + * Get the kind property: License kind. + * + * @return the kind value. + */ + public VcfLicenseKind kind() { + return this.kind; + } + + /** + * Get the provisioningState property: The state of the license provisioning. + * + * @return the provisioningState value. + */ + public LicenseProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The state of the license provisioning. + * + * @param provisioningState the provisioningState value to set. + * @return the VcfLicenseInner object itself. + */ + VcfLicenseInner withProvisioningState(LicenseProvisioningState provisioningState) { + this.provisioningState = provisioningState; + 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("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VcfLicenseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VcfLicenseInner 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 VcfLicenseInner. + */ + public static VcfLicenseInner 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 ("vcf5".equals(discriminatorValue)) { + return Vcf5License.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static VcfLicenseInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VcfLicenseInner deserializedVcfLicenseInner = new VcfLicenseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedVcfLicenseInner.kind = VcfLicenseKind.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedVcfLicenseInner.provisioningState + = LicenseProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVcfLicenseInner; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java index 766f5659639c..1bcdaa7797b7 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineInner.java @@ -143,6 +143,17 @@ public VirtualMachineRestrictMovementState restrictMovement() { return this.innerProperties() == null ? null : this.innerProperties().restrictMovement(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java index 4800f5a82709..12740fd6a631 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/VirtualMachineProperties.java @@ -94,6 +94,14 @@ public VirtualMachineRestrictMovementState restrictMovement() { return this.restrictMovement; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java index caad54a86091..8c43aace77e2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java @@ -108,6 +108,17 @@ public String id() { return this.id; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java index 5b71ecc179b9..23f2cef38a46 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java @@ -256,6 +256,17 @@ public WorkloadNetworkDnsServiceInner withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java index b73f32badc2d..160ab63b7b65 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceProperties.java @@ -205,6 +205,14 @@ public WorkloadNetworkDnsServiceProperties withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java index 87f53cd5fc9d..b93022ad1b33 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java @@ -245,6 +245,17 @@ public WorkloadNetworkDnsZoneInner withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java index d85fb712b934..17638bf7fe08 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneProperties.java @@ -188,6 +188,14 @@ public WorkloadNetworkDnsZoneProperties withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java index 90ecb715a783..9f3f78dea743 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java @@ -124,6 +124,17 @@ public String path() { return this.innerProperties() == null ? null : this.innerProperties().path(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java index 9e53700656e0..a282c4036e03 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayProperties.java @@ -65,6 +65,14 @@ public String path() { return this.path; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java index 216de1ac7d06..a78db495a5f0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkInner.java @@ -106,6 +106,17 @@ public WorkloadNetworkProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java index 8276882d9177..f97cfbf6bef9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java @@ -232,6 +232,17 @@ public WorkloadNetworkPortMirroringInner withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java index a7a46e519fc1..2d6ebb2c99c0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringProperties.java @@ -179,6 +179,14 @@ public WorkloadNetworkPortMirroringProperties withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java index b0c59738efa9..d05d7604eaee 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkProperties.java @@ -37,6 +37,14 @@ public WorkloadNetworkProvisioningState provisioningState() { return this.provisioningState; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java index ca37215370bb..afa4d42cc36c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpInner.java @@ -161,6 +161,17 @@ public WorkloadNetworkPublicIpProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java index ab3456f75321..eec42161c444 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPublicIpProperties.java @@ -101,6 +101,14 @@ public WorkloadNetworkPublicIpProvisioningState provisioningState() { return this.provisioningState; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java index 5e47de0cb2a4..ca41cd2fa325 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java @@ -220,6 +220,17 @@ public WorkloadNetworkSegmentInner withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentProperties.java index eeaa084890e0..869f82bccc88 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentProperties.java @@ -169,6 +169,20 @@ public WorkloadNetworkSegmentProperties withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (portVif() != null) { + portVif().forEach(e -> e.validate()); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java index 5852e4c9fef6..e6a1780120f0 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java @@ -186,6 +186,17 @@ public WorkloadNetworkVMGroupInner withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java index a12ef28dffb7..139e14021333 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupProperties.java @@ -128,6 +128,14 @@ public WorkloadNetworkVMGroupProperties withRevision(Long revision) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java index b77febbc7c5c..58c911905bc6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java @@ -125,6 +125,17 @@ public VMTypeEnum vmType() { return this.innerProperties() == null ? null : this.innerProperties().vmType(); } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java index aae6905d0058..4bd38e473af8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineProperties.java @@ -67,6 +67,14 @@ public VMTypeEnum vmType() { return this.vmType; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java index d61064e58c32..b57b3924554f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.AddonsClient; @@ -178,6 +179,22 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true) */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -215,6 +232,24 @@ private PagedFlux listAsync(String resourceGroupName, String private */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -236,6 +271,24 @@ private PagedResponse listSinglePage(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -290,6 +343,25 @@ public PagedIterable list(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String addonName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -329,6 +401,28 @@ private Mono getAsync(String resourceGroupName, String privateCloudN @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String addonName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, accept, context); @@ -365,6 +459,30 @@ public AddonInner get(String resourceGroupName, String privateCloudName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + return Mono.error(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -389,6 +507,33 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -412,6 +557,33 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -552,6 +724,25 @@ public AddonInner createOrUpdate(String resourceGroupName, String privateCloudNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String addonName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, context)) @@ -572,6 +763,28 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String addonName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, Context.NONE); } @@ -591,6 +804,28 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String addonName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, addonName, context); } @@ -711,6 +946,13 @@ public void delete(String resourceGroupName, String privateCloudName, String add */ @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(), @@ -729,6 +971,15 @@ private Mono> listNextSinglePageAsync(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -747,9 +998,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(AddonsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java index 2c99cad10d9c..522adf7045d9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.AuthorizationsClient; @@ -186,6 +187,22 @@ Response listNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -224,6 +241,24 @@ private PagedFlux listAsync(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -246,6 +281,24 @@ private PagedResponse listSinglePage(String reso @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -304,6 +357,26 @@ public PagedIterable list(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, accept, context)) @@ -343,6 +416,28 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, accept, context); @@ -380,6 +475,31 @@ public ExpressRouteAuthorizationInner get(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (authorization == null) { + return Mono.error(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + } else { + authorization.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -404,6 +524,34 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (authorization == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + } else { + authorization.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -427,6 +575,34 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String authorizationName, ExpressRouteAuthorizationInner authorization, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (authorization == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + } else { + authorization.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -574,6 +750,26 @@ public ExpressRouteAuthorizationInner createOrUpdate(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, context)) @@ -594,6 +790,28 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, Context.NONE); } @@ -613,6 +831,28 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, authorizationName, context); } @@ -735,6 +975,13 @@ public void delete(String resourceGroupName, String privateCloudName, String aut */ @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(), @@ -753,6 +1000,15 @@ private Mono> listNextSinglePageAs */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -772,10 +1028,21 @@ private PagedResponse listNextSinglePage(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(AuthorizationsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java index d079ff94279d..53cbca44836f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java @@ -36,7 +36,9 @@ import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; import com.azure.resourcemanager.avs.fluent.HostsClient; import com.azure.resourcemanager.avs.fluent.IscsiPathsClient; +import com.azure.resourcemanager.avs.fluent.LicensesClient; import com.azure.resourcemanager.avs.fluent.LocationsClient; +import com.azure.resourcemanager.avs.fluent.MaintenancesClient; import com.azure.resourcemanager.avs.fluent.OperationsClient; import com.azure.resourcemanager.avs.fluent.PlacementPoliciesClient; import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; @@ -286,6 +288,20 @@ public IscsiPathsClient getIscsiPaths() { return this.iscsiPaths; } + /** + * The LicensesClient object to access its operations. + */ + private final LicensesClient licenses; + + /** + * Gets the LicensesClient object to access its operations. + * + * @return the LicensesClient object. + */ + public LicensesClient getLicenses() { + return this.licenses; + } + /** * The LocationsClient object to access its operations. */ @@ -300,6 +316,20 @@ public LocationsClient getLocations() { return this.locations; } + /** + * The MaintenancesClient object to access its operations. + */ + private final MaintenancesClient maintenances; + + /** + * Gets the MaintenancesClient object to access its operations. + * + * @return the MaintenancesClient object. + */ + public MaintenancesClient getMaintenances() { + return this.maintenances; + } + /** * The PlacementPoliciesClient object to access its operations. */ @@ -457,7 +487,7 @@ public WorkloadNetworksClient getWorkloadNetworks() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2024-09-01"; + this.apiVersion = "2025-09-01"; this.operations = new OperationsClientImpl(this); this.addons = new AddonsClientImpl(this); this.authorizations = new AuthorizationsClientImpl(this); @@ -468,7 +498,9 @@ public WorkloadNetworksClient getWorkloadNetworks() { this.hcxEnterpriseSites = new HcxEnterpriseSitesClientImpl(this); this.hosts = new HostsClientImpl(this); this.iscsiPaths = new IscsiPathsClientImpl(this); + this.licenses = new LicensesClientImpl(this); this.locations = new LocationsClientImpl(this); + this.maintenances = new MaintenancesClientImpl(this); this.placementPolicies = new PlacementPoliciesClientImpl(this); this.privateClouds = new PrivateCloudsClientImpl(this); this.provisionedNetworks = new ProvisionedNetworksClientImpl(this); diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java index f94c6b4f7499..e517c5d04d7a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/CloudLinksClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.CloudLinksClient; @@ -179,6 +180,22 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = tr */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -216,6 +233,24 @@ private PagedFlux listAsync(String resourceGroupName, String pri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -237,6 +272,24 @@ private PagedResponse listSinglePage(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -291,6 +344,25 @@ public PagedIterable list(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String cloudLinkName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -330,6 +402,28 @@ private Mono getAsync(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, accept, context); @@ -366,6 +460,30 @@ public CloudLinkInner get(String resourceGroupName, String privateCloudName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + if (cloudLink == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + } else { + cloudLink.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -390,6 +508,34 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + if (cloudLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + } else { + cloudLink.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -413,6 +559,34 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String cloudLinkName, CloudLinkInner cloudLink, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } + if (cloudLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLink is required and cannot be null.")); + } else { + cloudLink.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -555,6 +729,25 @@ public CloudLinkInner createOrUpdate(String resourceGroupName, String privateClo @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String cloudLinkName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + return Mono.error(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, context)) @@ -575,6 +768,28 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String cloudLinkName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, Context.NONE); } @@ -594,6 +809,28 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String cloudLinkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (cloudLinkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cloudLinkName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, cloudLinkName, context); } @@ -715,6 +952,13 @@ public void delete(String resourceGroupName, String privateCloudName, String clo */ @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(), @@ -733,6 +977,15 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -751,9 +1004,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(CloudLinksClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java index fae2de12a953..ea939fe645af 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java @@ -32,6 +32,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.ClustersClient; @@ -222,6 +223,22 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = true */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -259,6 +276,24 @@ private PagedFlux listAsync(String resourceGroupName, String priva */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -280,6 +315,24 @@ private PagedResponse listSinglePage(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -334,6 +387,25 @@ public PagedIterable list(String resourceGroupName, String private @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -373,6 +445,28 @@ private Mono getAsync(String resourceGroupName, String privateClou @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); @@ -409,6 +503,30 @@ public ClusterInner get(String resourceGroupName, String privateCloudName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -433,6 +551,34 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -456,6 +602,34 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -598,6 +772,30 @@ public ClusterInner createOrUpdate(String resourceGroupName, String privateCloud @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterUpdate == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + } else { + clusterUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -622,6 +820,34 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + } else { + clusterUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -645,6 +871,34 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + } else { + clusterUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -786,6 +1040,25 @@ public ClusterInner update(String resourceGroupName, String privateCloudName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, context)) @@ -806,6 +1079,28 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, Context.NONE); } @@ -825,6 +1120,28 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, context); } @@ -949,6 +1266,25 @@ public void delete(String resourceGroupName, String privateCloudName, String clu @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listZonesWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listZones(this.client.getEndpoint(), this.client.getApiVersion(), @@ -989,6 +1325,28 @@ private Mono listZonesAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response listZonesWithResponse(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return service.listZonesSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); @@ -1022,6 +1380,13 @@ public ClusterZoneListInner listZones(String resourceGroupName, String privateCl */ @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(), @@ -1040,6 +1405,15 @@ private Mono> listNextSinglePageAsync(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -1058,9 +1432,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(ClustersClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java index 5512ec091ecd..25e61693a677 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.DatastoresClient; @@ -183,6 +184,25 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = tr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -223,6 +243,28 @@ private PagedFlux listAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); @@ -245,6 +287,28 @@ private PagedResponse listSinglePage(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); @@ -303,6 +367,28 @@ public PagedIterable list(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -346,6 +432,32 @@ private Mono getAsync(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, accept, context); @@ -386,6 +498,33 @@ public DatastoreInner get(String resourceGroupName, String privateCloudName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + return Mono.error(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -411,6 +550,38 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -435,6 +606,38 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, DatastoreInner datastore, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -586,6 +789,28 @@ public DatastoreInner createOrUpdate(String resourceGroupName, String privateClo @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -606,6 +831,32 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, Context.NONE); @@ -627,6 +878,32 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, datastoreName, context); } @@ -758,6 +1035,13 @@ public void delete(String resourceGroupName, String privateCloudName, String clu */ @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(), @@ -776,6 +1060,15 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -794,9 +1087,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(DatastoresClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java index 12437e7fcf1c..45e487fb1177 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; @@ -185,6 +186,22 @@ Response listNextSync(@PathParam(value = "nextLink", @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -223,6 +240,24 @@ private PagedFlux listAsync(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -245,6 +280,24 @@ private PagedResponse listSinglePage(String resource @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -301,6 +354,26 @@ public PagedIterable list(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -342,6 +415,29 @@ private Mono getAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, accept, context); @@ -379,6 +475,32 @@ public GlobalReachConnectionInner get(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -403,6 +525,35 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -426,6 +577,35 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String globalReachConnectionName, GlobalReachConnectionInner globalReachConnection, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -573,6 +753,26 @@ public GlobalReachConnectionInner createOrUpdate(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter globalReachConnectionName is required and cannot be null.")); + } return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -592,6 +792,29 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, Context.NONE); @@ -612,6 +835,29 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, globalReachConnectionName, context); } @@ -737,6 +983,13 @@ public void delete(String resourceGroupName, String privateCloudName, String glo */ @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(), @@ -755,6 +1008,15 @@ private Mono> listNextSinglePageAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -774,10 +1036,21 @@ private PagedResponse listNextSinglePage(String next */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(GlobalReachConnectionsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java index ab41d5acc2dd..788bc3575985 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; import com.azure.resourcemanager.avs.implementation.models.HcxEnterpriseSiteList; @@ -178,6 +179,22 @@ Response listNextSync(@PathParam(value = "nextLink", enco @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -215,6 +232,24 @@ private PagedFlux listAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -236,6 +271,24 @@ private PagedResponse listSinglePage(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -291,6 +344,26 @@ public PagedIterable list(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -332,6 +405,28 @@ private Mono getAsync(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, accept, context); @@ -368,6 +463,32 @@ public HcxEnterpriseSiteInner get(String resourceGroupName, String privateCloudN @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, HcxEnterpriseSiteInner hcxEnterpriseSite) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + if (hcxEnterpriseSite == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSite is required and cannot be null.")); + } else { + hcxEnterpriseSite.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -413,6 +534,34 @@ private Mono createOrUpdateAsync(String resourceGroupNam public Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, HcxEnterpriseSiteInner hcxEnterpriseSite, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + if (hcxEnterpriseSite == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSite is required and cannot be null.")); + } else { + hcxEnterpriseSite.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -453,6 +602,26 @@ public HcxEnterpriseSiteInner createOrUpdate(String resourceGroupName, String pr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context)) @@ -491,6 +660,28 @@ private Mono deleteAsync(String resourceGroupName, String privateCloudName @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context); } @@ -522,6 +713,13 @@ public void delete(String resourceGroupName, String privateCloudName, String hcx */ @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(), @@ -540,6 +738,15 @@ private Mono> listNextSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -559,10 +766,21 @@ private PagedResponse listNextSinglePage(String nextLink */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(HcxEnterpriseSitesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java index 770a1cc19c0d..8c45ac99ff07 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HostsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.HostsClient; import com.azure.resourcemanager.avs.fluent.models.HostModelInner; import com.azure.resourcemanager.avs.implementation.models.HostListResult; @@ -130,6 +131,25 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = t @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -170,6 +190,28 @@ private PagedFlux listAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); @@ -192,6 +234,28 @@ private PagedResponse listSinglePage(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); @@ -250,6 +314,28 @@ public PagedIterable list(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String hostId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hostId == null) { + return Mono.error(new IllegalArgumentException("Parameter hostId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, hostId, accept, context)) @@ -291,6 +377,32 @@ private Mono getAsync(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String hostId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hostId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter hostId is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, hostId, accept, context); @@ -325,6 +437,13 @@ public HostModelInner get(String resourceGroupName, String privateCloudName, Str */ @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(), @@ -343,6 +462,15 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -361,9 +489,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(HostsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java index aaf598e40cb7..5fb7622b565f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/IscsiPathsClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.IscsiPathsClient; @@ -180,6 +181,22 @@ Response listByPrivateCloudNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateCloudSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByPrivateCloud(this.client.getEndpoint(), this.client.getApiVersion(), @@ -218,6 +235,24 @@ private PagedFlux listByPrivateCloudAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByPrivateCloudSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listByPrivateCloudSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -240,6 +275,24 @@ private PagedResponse listByPrivateCloudSinglePage(String resour @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByPrivateCloudSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listByPrivateCloudSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -294,6 +347,22 @@ public PagedIterable listByPrivateCloud(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -331,6 +400,24 @@ private Mono getAsync(String resourceGroupName, String privateCl @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -365,6 +452,27 @@ public IscsiPathInner get(String resourceGroupName, String privateCloudName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, IscsiPathInner resource) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -388,6 +496,30 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, IscsiPathInner resource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -410,6 +542,30 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, IscsiPathInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -542,6 +698,22 @@ public IscsiPathInner createOrUpdate(String resourceGroupName, String privateClo @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context)) @@ -560,6 +732,24 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, Context.NONE); } @@ -578,6 +768,24 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context); } @@ -690,6 +898,13 @@ public void delete(String resourceGroupName, String privateCloudName, Context co */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPrivateCloudNextSinglePageAsync(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( @@ -710,6 +925,15 @@ private Mono> listByPrivateCloudNextSinglePageAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByPrivateCloudNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listByPrivateCloudNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -729,10 +953,21 @@ private PagedResponse listByPrivateCloudNextSinglePage(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByPrivateCloudNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listByPrivateCloudNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(IscsiPathsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicenseImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicenseImpl.java new file mode 100644 index 000000000000..844a37c5229a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicenseImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.LicenseInner; +import com.azure.resourcemanager.avs.fluent.models.LicensePropertiesInner; +import com.azure.resourcemanager.avs.models.License; +import com.azure.resourcemanager.avs.models.LicenseName; +import com.azure.resourcemanager.avs.models.LicenseProperties; + +public final class LicenseImpl implements License, License.Definition, License.Update { + private LicenseInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LicenseProperties properties() { + LicensePropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new LicensePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LicenseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private LicenseName licenseName; + + public LicenseImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public License create() { + this.innerObject = serviceManager.serviceClient() + .getLicenses() + .createOrUpdate(resourceGroupName, privateCloudName, licenseName, this.innerModel(), Context.NONE); + return this; + } + + public License create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLicenses() + .createOrUpdate(resourceGroupName, privateCloudName, licenseName, this.innerModel(), context); + return this; + } + + LicenseImpl(LicenseName name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new LicenseInner(); + this.serviceManager = serviceManager; + this.licenseName = name; + } + + public LicenseImpl update() { + return this; + } + + public License apply() { + this.innerObject = serviceManager.serviceClient() + .getLicenses() + .createOrUpdate(resourceGroupName, privateCloudName, licenseName, this.innerModel(), Context.NONE); + return this; + } + + public License apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLicenses() + .createOrUpdate(resourceGroupName, privateCloudName, licenseName, this.innerModel(), context); + return this; + } + + LicenseImpl(LicenseInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.licenseName + = LicenseName.fromString(ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "licenses")); + } + + public License refresh() { + this.innerObject = serviceManager.serviceClient() + .getLicenses() + .getWithResponse(resourceGroupName, privateCloudName, licenseName, Context.NONE) + .getValue(); + return this; + } + + public License refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLicenses() + .getWithResponse(resourceGroupName, privateCloudName, licenseName, context) + .getValue(); + return this; + } + + public Response getPropertiesWithResponse(Context context) { + return serviceManager.licenses() + .getPropertiesWithResponse(resourceGroupName, privateCloudName, licenseName, context); + } + + public LicenseProperties getProperties() { + return serviceManager.licenses().getProperties(resourceGroupName, privateCloudName, licenseName); + } + + public LicenseImpl withProperties(LicensePropertiesInner properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensePropertiesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensePropertiesImpl.java new file mode 100644 index 000000000000..04978490b6ef --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensePropertiesImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.LicensePropertiesInner; +import com.azure.resourcemanager.avs.models.LicenseKind; +import com.azure.resourcemanager.avs.models.LicenseProperties; +import com.azure.resourcemanager.avs.models.LicenseProvisioningState; + +public final class LicensePropertiesImpl implements LicenseProperties { + private LicensePropertiesInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + LicensePropertiesImpl(LicensePropertiesInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public LicenseKind kind() { + return this.innerModel().kind(); + } + + public LicenseProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public LicensePropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensesClientImpl.java new file mode 100644 index 000000000000..add3db2b5f1e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensesClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.Post; +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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.LicensesClient; +import com.azure.resourcemanager.avs.fluent.models.LicenseInner; +import com.azure.resourcemanager.avs.fluent.models.LicensePropertiesInner; +import com.azure.resourcemanager.avs.implementation.models.LicenseListResult; +import com.azure.resourcemanager.avs.models.LicenseName; +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 LicensesClient. + */ +public final class LicensesClientImpl implements LicensesClient { + /** + * The proxy service used to perform REST calls. + */ + private final LicensesService service; + + /** + * The service client containing this operation class. + */ + private final AvsClientImpl client; + + /** + * Initializes an instance of LicensesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LicensesClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(LicensesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientLicenses to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AvsClientLicenses") + public interface LicensesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses") + @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("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses") + @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("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}") + @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("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}") + @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("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LicenseInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") LicenseInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}") + @ExpectedResponses({ 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("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}") + @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("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}/getProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getProperties(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/licenses/{licenseName}/getProperties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPropertiesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @PathParam("licenseName") LicenseName licenseName, + @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); + } + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a License list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, 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())); + } + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a License list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a License list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a License list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a License list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List License resources by PrivateCloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a License list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 License along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, + LicenseName licenseName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 License on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, LicenseName licenseName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, licenseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 License along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String privateCloudName, + LicenseName licenseName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, licenseName, accept, context); + } + + /** + * Get a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 License. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner get(String resourceGroupName, String privateCloudName, LicenseName licenseName) { + return getWithResponse(resourceGroupName, privateCloudName, licenseName, Context.NONE).getValue(); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String privateCloudName, LicenseName licenseName, LicenseInner resource) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + 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, privateCloudName, licenseName, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + LicenseName licenseName, LicenseInner resource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, contentType, accept, + resource, Context.NONE); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, + LicenseName licenseName, LicenseInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, contentType, accept, + resource, context); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 PollerFlux} for polling of a license resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LicenseInner> beginCreateOrUpdateAsync(String resourceGroupName, + String privateCloudName, LicenseName licenseName, LicenseInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, licenseName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + LicenseInner.class, LicenseInner.class, this.client.getContext()); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginCreateOrUpdate(String resourceGroupName, + String privateCloudName, LicenseName licenseName, LicenseInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, licenseName, resource); + return this.client.getLroResult(response, LicenseInner.class, LicenseInner.class, + Context.NONE); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 {@link SyncPoller} for polling of a license resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LicenseInner> beginCreateOrUpdate(String resourceGroupName, + String privateCloudName, LicenseName licenseName, LicenseInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, privateCloudName, licenseName, resource, context); + return this.client.getLroResult(response, LicenseInner.class, LicenseInner.class, + context); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String privateCloudName, + LicenseName licenseName, LicenseInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, licenseName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner createOrUpdate(String resourceGroupName, String privateCloudName, LicenseName licenseName, + LicenseInner resource) { + return beginCreateOrUpdate(resourceGroupName, privateCloudName, licenseName, resource).getFinalResult(); + } + + /** + * Create a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param resource Resource create 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 a license resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicenseInner createOrUpdate(String resourceGroupName, String privateCloudName, LicenseName licenseName, + LicenseInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, privateCloudName, licenseName, resource, context) + .getFinalResult(); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateCloudName, + LicenseName licenseName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateCloudName, + LicenseName licenseName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, Context.NONE); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateCloudName, + LicenseName licenseName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, context); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateCloudName, + LicenseName licenseName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, privateCloudName, licenseName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateCloudName, + LicenseName licenseName) { + Response response = deleteWithResponse(resourceGroupName, privateCloudName, licenseName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateCloudName, + LicenseName licenseName, Context context) { + Response response = deleteWithResponse(resourceGroupName, privateCloudName, licenseName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 privateCloudName, LicenseName licenseName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, licenseName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateCloudName, LicenseName licenseName) { + beginDelete(resourceGroupName, privateCloudName, licenseName).getFinalResult(); + } + + /** + * Delete a License. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateCloudName, LicenseName licenseName, Context context) { + beginDelete(resourceGroupName, privateCloudName, licenseName, context).getFinalResult(); + } + + /** + * Just like ArmResourceActionSync, but with no request body. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a license along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPropertiesWithResponseAsync(String resourceGroupName, + String privateCloudName, LicenseName licenseName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + return Mono.error(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getProperties(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Just like ArmResourceActionSync, but with no request body. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a license on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPropertiesAsync(String resourceGroupName, String privateCloudName, + LicenseName licenseName) { + return getPropertiesWithResponseAsync(resourceGroupName, privateCloudName, licenseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Just like ArmResourceActionSync, but with no request body. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a license along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPropertiesWithResponse(String resourceGroupName, String privateCloudName, + LicenseName licenseName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (licenseName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter licenseName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPropertiesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, licenseName, accept, context); + } + + /** + * Just like ArmResourceActionSync, but with no request body. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param licenseName Name of the license. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a license. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LicensePropertiesInner getProperties(String resourceGroupName, String privateCloudName, + LicenseName licenseName) { + return getPropertiesWithResponse(resourceGroupName, privateCloudName, licenseName, Context.NONE).getValue(); + } + + /** + * 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 the response of a License list operation 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(), + 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 the response of a License list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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 the response of a License list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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); + } + + private static final ClientLogger LOGGER = new ClientLogger(LicensesClientImpl.class); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensesImpl.java new file mode 100644 index 000000000000..fce9a37039ee --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LicensesImpl.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.avs.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.avs.fluent.LicensesClient; +import com.azure.resourcemanager.avs.fluent.models.LicenseInner; +import com.azure.resourcemanager.avs.fluent.models.LicensePropertiesInner; +import com.azure.resourcemanager.avs.models.License; +import com.azure.resourcemanager.avs.models.LicenseName; +import com.azure.resourcemanager.avs.models.LicenseProperties; +import com.azure.resourcemanager.avs.models.Licenses; + +public final class LicensesImpl implements Licenses { + private static final ClientLogger LOGGER = new ClientLogger(LicensesImpl.class); + + private final LicensesClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public LicensesImpl(LicensesClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LicenseImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LicenseImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String privateCloudName, LicenseName licenseName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, licenseName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LicenseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public License get(String resourceGroupName, String privateCloudName, LicenseName licenseName) { + LicenseInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, licenseName); + if (inner != null) { + return new LicenseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, LicenseName licenseName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, licenseName); + } + + public void delete(String resourceGroupName, String privateCloudName, LicenseName licenseName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, licenseName, context); + } + + public Response getPropertiesWithResponse(String resourceGroupName, String privateCloudName, + LicenseName licenseName, Context context) { + Response inner + = this.serviceClient().getPropertiesWithResponse(resourceGroupName, privateCloudName, licenseName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LicensePropertiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LicenseProperties getProperties(String resourceGroupName, String privateCloudName, LicenseName licenseName) { + LicensePropertiesInner inner + = this.serviceClient().getProperties(resourceGroupName, privateCloudName, licenseName); + if (inner != null) { + return new LicensePropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public License 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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String licenseNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "licenses"); + if (licenseNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + LicenseName licenseName = LicenseName.fromString(licenseNameLocal); + return this.getWithResponse(resourceGroupName, privateCloudName, licenseName, 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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String licenseNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "licenses"); + if (licenseNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + LicenseName licenseName = LicenseName.fromString(licenseNameLocal); + return this.getWithResponse(resourceGroupName, privateCloudName, licenseName, 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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String licenseNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "licenses"); + if (licenseNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + LicenseName licenseName = LicenseName.fromString(licenseNameLocal); + this.delete(resourceGroupName, privateCloudName, licenseName, 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 privateCloudName = ResourceManagerUtils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String licenseNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "licenses"); + if (licenseNameLocal == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'licenses'.", id))); + } + LicenseName licenseName = LicenseName.fromString(licenseNameLocal); + this.delete(resourceGroupName, privateCloudName, licenseName, context); + } + + private LicensesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public LicenseImpl define(LicenseName name) { + return new LicenseImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java index a5252c941cc5..1c3eb41df0ce 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java @@ -22,6 +22,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.LocationsClient; import com.azure.resourcemanager.avs.fluent.models.QuotaInner; import com.azure.resourcemanager.avs.fluent.models.TrialInner; @@ -107,6 +108,20 @@ Response checkQuotaAvailabilitySync(@HostParam("endpoint") String en */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkTrialAvailabilityWithResponseAsync(String location, Sku sku) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sku != null) { + sku.validate(); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkTrialAvailability(this.client.getEndpoint(), @@ -142,6 +157,23 @@ private Mono checkTrialAvailabilityAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkTrialAvailabilityWithResponse(String location, Sku sku, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sku != null) { + sku.validate(); + } final String accept = "application/json"; return service.checkTrialAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, sku, context); @@ -173,6 +205,17 @@ public TrialInner checkTrialAvailability(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkQuotaAvailabilityWithResponseAsync(String location) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkQuotaAvailability(this.client.getEndpoint(), @@ -206,6 +249,20 @@ private Mono checkQuotaAvailabilityAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkQuotaAvailabilityWithResponse(String location, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } final String accept = "application/json"; return service.checkQuotaAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); @@ -224,4 +281,6 @@ public Response checkQuotaAvailabilityWithResponse(String location, public QuotaInner checkQuotaAvailability(String location) { return checkQuotaAvailabilityWithResponse(location, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(LocationsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenanceImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenanceImpl.java new file mode 100644 index 000000000000..f84c6f30c135 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenanceImpl.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.avs.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.avs.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.avs.models.Maintenance; +import com.azure.resourcemanager.avs.models.MaintenanceProperties; + +public final class MaintenanceImpl implements Maintenance { + private MaintenanceInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + MaintenanceImpl(MaintenanceInner innerObject, com.azure.resourcemanager.avs.AvsManager 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 MaintenanceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MaintenanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenancesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenancesClientImpl.java new file mode 100644 index 000000000000..ee5287ca1fb3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenancesClientImpl.java @@ -0,0 +1,1010 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.MaintenancesClient; +import com.azure.resourcemanager.avs.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.avs.implementation.models.MaintenanceListResult; +import com.azure.resourcemanager.avs.models.MaintenanceReschedule; +import com.azure.resourcemanager.avs.models.MaintenanceSchedule; +import com.azure.resourcemanager.avs.models.MaintenanceStateName; +import com.azure.resourcemanager.avs.models.MaintenanceStatusFilter; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MaintenancesClient. + */ +public final class MaintenancesClientImpl implements MaintenancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final MaintenancesService service; + + /** + * The service client containing this operation class. + */ + private final AvsClientImpl client; + + /** + * Initializes an instance of MaintenancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MaintenancesClientImpl(AvsClientImpl client) { + this.service + = RestProxy.create(MaintenancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientMaintenances to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AvsClientMaintenances") + public interface MaintenancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances") + @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("privateCloudName") String privateCloudName, + @QueryParam("stateName") MaintenanceStateName stateName, + @QueryParam("status") MaintenanceStatusFilter status, @QueryParam("from") OffsetDateTime from, + @QueryParam("to") OffsetDateTime to, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances") + @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("privateCloudName") String privateCloudName, + @QueryParam("stateName") MaintenanceStateName stateName, + @QueryParam("status") MaintenanceStatusFilter status, @QueryParam("from") OffsetDateTime from, + @QueryParam("to") OffsetDateTime to, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}") + @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("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}") + @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("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}/reschedule") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> reschedule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MaintenanceReschedule body, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}/reschedule") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rescheduleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MaintenanceReschedule body, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}/schedule") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> schedule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MaintenanceSchedule body, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}/schedule") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response scheduleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MaintenanceSchedule body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}/initiateChecks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> initiateChecks(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/maintenances/{maintenanceName}/initiateChecks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response initiateChecksSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("maintenanceName") String maintenanceName, @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); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param stateName Filter maintenances based on state. + * @param status Filter active or inactive maintenances. + * @param from date from which result should be returned. ie. scheduledStartTime >= from. + * @param to date till which result should be returned. i.e. scheduledStartTime <= to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, stateName, status, from, to, + 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())); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param stateName Filter maintenances based on state. + * @param status Filter active or inactive maintenances. + * @param from date from which result should be returned. ie. scheduledStartTime >= from. + * @param to date till which result should be returned. i.e. scheduledStartTime <= to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, stateName, status, from, to), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + final MaintenanceStateName stateName = null; + final MaintenanceStatusFilter status = null; + final OffsetDateTime from = null; + final OffsetDateTime to = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, stateName, status, from, to), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param stateName Filter maintenances based on state. + * @param status Filter active or inactive maintenances. + * @param from date from which result should be returned. ie. scheduledStartTime >= from. + * @param to date till which result should be returned. i.e. scheduledStartTime <= to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, stateName, status, from, to, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param stateName Filter maintenances based on state. + * @param status Filter active or inactive maintenances. + * @param from date from which result should be returned. ie. scheduledStartTime >= from. + * @param to date till which result should be returned. i.e. scheduledStartTime <= to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, stateName, status, from, to, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + final MaintenanceStateName stateName = null; + final MaintenanceStatusFilter status = null; + final OffsetDateTime from = null; + final OffsetDateTime to = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, privateCloudName, stateName, status, from, to), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Maintenance resources by subscription ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param stateName Filter maintenances based on state. + * @param status Filter active or inactive maintenances. + * @param from date from which result should be returned. ie. scheduledStartTime >= from. + * @param to date till which result should be returned. i.e. scheduledStartTime <= to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of a Maintenance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to, + Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, privateCloudName, stateName, status, from, to, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get a Maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Maintenance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, + String maintenanceName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Maintenance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, String maintenanceName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, maintenanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Maintenance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, privateCloudName, maintenanceName, accept, context); + } + + /** + * Get a Maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Maintenance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner get(String resourceGroupName, String privateCloudName, String maintenanceName) { + return getWithResponse(resourceGroupName, privateCloudName, maintenanceName, Context.NONE).getValue(); + } + + /** + * Reschedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> rescheduleWithResponseAsync(String resourceGroupName, + String privateCloudName, String maintenanceName, MaintenanceReschedule body) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reschedule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reschedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rescheduleAsync(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceReschedule body) { + return rescheduleWithResponseAsync(resourceGroupName, privateCloudName, maintenanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Reschedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action 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 a cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response rescheduleWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceReschedule body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.rescheduleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, contentType, accept, + body, context); + } + + /** + * Reschedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner reschedule(String resourceGroupName, String privateCloudName, String maintenanceName, + MaintenanceReschedule body) { + return rescheduleWithResponse(resourceGroupName, privateCloudName, maintenanceName, body, Context.NONE) + .getValue(); + } + + /** + * Schedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> scheduleWithResponseAsync(String resourceGroupName, + String privateCloudName, String maintenanceName, MaintenanceSchedule body) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.schedule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Schedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scheduleAsync(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceSchedule body) { + return scheduleWithResponseAsync(resourceGroupName, privateCloudName, maintenanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Schedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action 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 a cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response scheduleWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceSchedule body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.scheduleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, contentType, accept, + body, context); + } + + /** + * Schedule a maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner schedule(String resourceGroupName, String privateCloudName, String maintenanceName, + MaintenanceSchedule body) { + return scheduleWithResponse(resourceGroupName, privateCloudName, maintenanceName, body, Context.NONE) + .getValue(); + } + + /** + * Initiate maintenance readiness checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> initiateChecksWithResponseAsync(String resourceGroupName, + String privateCloudName, String maintenanceName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.initiateChecks(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initiate maintenance readiness checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initiateChecksAsync(String resourceGroupName, String privateCloudName, + String maintenanceName) { + return initiateChecksWithResponseAsync(resourceGroupName, privateCloudName, maintenanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Initiate maintenance readiness checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response initiateChecksWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (maintenanceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter maintenanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.initiateChecksSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, maintenanceName, accept, context); + } + + /** + * Initiate maintenance readiness checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param maintenanceName Name of the maintenance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceInner initiateChecks(String resourceGroupName, String privateCloudName, String maintenanceName) { + return initiateChecksWithResponse(resourceGroupName, privateCloudName, maintenanceName, Context.NONE) + .getValue(); + } + + /** + * 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 the response of a Maintenance list operation 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(), + 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 the response of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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 the response of a Maintenance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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); + } + + private static final ClientLogger LOGGER = new ClientLogger(MaintenancesClientImpl.class); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenancesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenancesImpl.java new file mode 100644 index 000000000000..7a535dbfe18d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/MaintenancesImpl.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.avs.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.avs.fluent.MaintenancesClient; +import com.azure.resourcemanager.avs.fluent.models.MaintenanceInner; +import com.azure.resourcemanager.avs.models.Maintenance; +import com.azure.resourcemanager.avs.models.MaintenanceReschedule; +import com.azure.resourcemanager.avs.models.MaintenanceSchedule; +import com.azure.resourcemanager.avs.models.MaintenanceStateName; +import com.azure.resourcemanager.avs.models.MaintenanceStatusFilter; +import com.azure.resourcemanager.avs.models.Maintenances; +import java.time.OffsetDateTime; + +public final class MaintenancesImpl implements Maintenances { + private static final ClientLogger LOGGER = new ClientLogger(MaintenancesImpl.class); + + private final MaintenancesClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public MaintenancesImpl(MaintenancesClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, + MaintenanceStateName stateName, MaintenanceStatusFilter status, OffsetDateTime from, OffsetDateTime to, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, privateCloudName, stateName, status, from, to, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, maintenanceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Maintenance get(String resourceGroupName, String privateCloudName, String maintenanceName) { + MaintenanceInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, maintenanceName); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response rescheduleWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceReschedule body, Context context) { + Response inner = this.serviceClient() + .rescheduleWithResponse(resourceGroupName, privateCloudName, maintenanceName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Maintenance reschedule(String resourceGroupName, String privateCloudName, String maintenanceName, + MaintenanceReschedule body) { + MaintenanceInner inner + = this.serviceClient().reschedule(resourceGroupName, privateCloudName, maintenanceName, body); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response scheduleWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, MaintenanceSchedule body, Context context) { + Response inner = this.serviceClient() + .scheduleWithResponse(resourceGroupName, privateCloudName, maintenanceName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Maintenance schedule(String resourceGroupName, String privateCloudName, String maintenanceName, + MaintenanceSchedule body) { + MaintenanceInner inner + = this.serviceClient().schedule(resourceGroupName, privateCloudName, maintenanceName, body); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response initiateChecksWithResponse(String resourceGroupName, String privateCloudName, + String maintenanceName, Context context) { + Response inner = this.serviceClient() + .initiateChecksWithResponse(resourceGroupName, privateCloudName, maintenanceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Maintenance initiateChecks(String resourceGroupName, String privateCloudName, String maintenanceName) { + MaintenanceInner inner + = this.serviceClient().initiateChecks(resourceGroupName, privateCloudName, maintenanceName); + if (inner != null) { + return new MaintenanceImpl(inner, this.manager()); + } else { + return null; + } + } + + private MaintenancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java index c71bef2a3307..f0206c1d8f78 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.OperationsClient; import com.azure.resourcemanager.avs.fluent.models.OperationInner; import com.azure.resourcemanager.avs.implementation.models.OperationListResult; @@ -101,6 +102,10 @@ Response listNextSync(@PathParam(value = "nextLink", encode */ @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( @@ -132,6 +137,11 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); @@ -150,6 +160,11 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); @@ -197,6 +212,13 @@ public PagedIterable list(Context context) { */ @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(), @@ -215,6 +237,15 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -234,9 +265,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java index 9430df358515..60a85400048d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PlacementPoliciesClientImpl.java @@ -31,6 +31,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.PlacementPoliciesClient; @@ -209,6 +210,25 @@ Response listNextSync(@PathParam(value = "nextLink", enco @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -250,6 +270,28 @@ private PagedFlux listAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); @@ -272,6 +314,28 @@ private PagedResponse listSinglePage(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); @@ -331,6 +395,29 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -374,6 +461,32 @@ private Mono getAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, accept, context); @@ -415,6 +528,35 @@ public PlacementPolicyInner get(String resourceGroupName, String privateCloudNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicy == null) { + return Mono + .error(new IllegalArgumentException("Parameter placementPolicy is required and cannot be null.")); + } else { + placementPolicy.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -440,6 +582,38 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicy == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicy is required and cannot be null.")); + } else { + placementPolicy.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -464,6 +638,38 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyInner placementPolicy, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicy == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicy is required and cannot be null.")); + } else { + placementPolicy.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -619,6 +825,35 @@ public PlacementPolicyInner createOrUpdate(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicyUpdate == null) { + return Mono + .error(new IllegalArgumentException("Parameter placementPolicyUpdate is required and cannot be null.")); + } else { + placementPolicyUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -644,6 +879,38 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicyUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyUpdate is required and cannot be null.")); + } else { + placementPolicyUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -668,6 +935,38 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, PlacementPolicyUpdate placementPolicyUpdate, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } + if (placementPolicyUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyUpdate is required and cannot be null.")); + } else { + placementPolicyUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -821,6 +1120,29 @@ public PlacementPolicyInner update(String resourceGroupName, String privateCloud @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, @@ -843,6 +1165,32 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, Context.NONE); @@ -864,6 +1212,32 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String placementPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (placementPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter placementPolicyName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, placementPolicyName, context); @@ -997,6 +1371,13 @@ public void delete(String resourceGroupName, String privateCloudName, String clu */ @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(), @@ -1015,6 +1396,15 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1034,10 +1424,21 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(PlacementPoliciesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java index b0c23572d024..830cbad8ca8e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.fluent.models.VcfLicenseInner; import com.azure.resourcemanager.avs.models.AdminCredentials; import com.azure.resourcemanager.avs.models.AvailabilityProperties; import com.azure.resourcemanager.avs.models.Circuit; @@ -24,6 +25,7 @@ import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState; import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; import com.azure.resourcemanager.avs.models.Sku; +import com.azure.resourcemanager.avs.models.VcfLicense; import java.util.Collections; import java.util.List; import java.util.Map; @@ -182,6 +184,15 @@ public DnsZoneType dnsZoneType() { return this.innerModel().dnsZoneType(); } + public VcfLicense vcfLicense() { + VcfLicenseInner inner = this.innerModel().vcfLicense(); + if (inner != null) { + return new VcfLicenseImpl(inner, this.manager()); + } else { + return null; + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -300,6 +311,14 @@ public AdminCredentials listAdminCredentials() { return serviceManager.privateClouds().listAdminCredentials(resourceGroupName, privateCloudName); } + public Response getVcfLicenseWithResponse(Context context) { + return serviceManager.privateClouds().getVcfLicenseWithResponse(resourceGroupName, privateCloudName, context); + } + + public VcfLicense getVcfLicense() { + return serviceManager.privateClouds().getVcfLicense(resourceGroupName, privateCloudName); + } + public PrivateCloudImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -440,6 +459,11 @@ public PrivateCloudImpl withDnsZoneType(DnsZoneType dnsZoneType) { } } + public PrivateCloudImpl withVcfLicense(VcfLicenseInner vcfLicense) { + this.innerModel().withVcfLicense(vcfLicense); + return this; + } + private boolean isInCreateMode() { return this.innerModel() == null || this.innerModel().id() == null; } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudPropertiesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudPropertiesImpl.java new file mode 100644 index 000000000000..bf114e8ab953 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudPropertiesImpl.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudPropertiesInner; +import com.azure.resourcemanager.avs.fluent.models.VcfLicenseInner; +import com.azure.resourcemanager.avs.models.AvailabilityProperties; +import com.azure.resourcemanager.avs.models.Circuit; +import com.azure.resourcemanager.avs.models.DnsZoneType; +import com.azure.resourcemanager.avs.models.Encryption; +import com.azure.resourcemanager.avs.models.Endpoints; +import com.azure.resourcemanager.avs.models.IdentitySource; +import com.azure.resourcemanager.avs.models.InternetEnum; +import com.azure.resourcemanager.avs.models.ManagementCluster; +import com.azure.resourcemanager.avs.models.NsxPublicIpQuotaRaisedEnum; +import com.azure.resourcemanager.avs.models.PrivateCloudProperties; +import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState; +import com.azure.resourcemanager.avs.models.VcfLicense; +import java.util.Collections; +import java.util.List; + +public final class PrivateCloudPropertiesImpl implements PrivateCloudProperties { + private PrivateCloudPropertiesInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + PrivateCloudPropertiesImpl(PrivateCloudPropertiesInner innerObject, + com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ManagementCluster managementCluster() { + return this.innerModel().managementCluster(); + } + + public InternetEnum internet() { + return this.innerModel().internet(); + } + + public List identitySources() { + List inner = this.innerModel().identitySources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AvailabilityProperties availability() { + return this.innerModel().availability(); + } + + public Encryption encryption() { + return this.innerModel().encryption(); + } + + public List extendedNetworkBlocks() { + List inner = this.innerModel().extendedNetworkBlocks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateCloudProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Circuit circuit() { + return this.innerModel().circuit(); + } + + public Endpoints endpoints() { + return this.innerModel().endpoints(); + } + + public String networkBlock() { + return this.innerModel().networkBlock(); + } + + public String managementNetwork() { + return this.innerModel().managementNetwork(); + } + + public String provisioningNetwork() { + return this.innerModel().provisioningNetwork(); + } + + public String vmotionNetwork() { + return this.innerModel().vmotionNetwork(); + } + + public String vcenterPassword() { + return this.innerModel().vcenterPassword(); + } + + public String nsxtPassword() { + return this.innerModel().nsxtPassword(); + } + + public String vcenterCertificateThumbprint() { + return this.innerModel().vcenterCertificateThumbprint(); + } + + public String nsxtCertificateThumbprint() { + return this.innerModel().nsxtCertificateThumbprint(); + } + + public List externalCloudLinks() { + List inner = this.innerModel().externalCloudLinks(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Circuit secondaryCircuit() { + return this.innerModel().secondaryCircuit(); + } + + public NsxPublicIpQuotaRaisedEnum nsxPublicIpQuotaRaised() { + return this.innerModel().nsxPublicIpQuotaRaised(); + } + + public String virtualNetworkId() { + return this.innerModel().virtualNetworkId(); + } + + public DnsZoneType dnsZoneType() { + return this.innerModel().dnsZoneType(); + } + + public VcfLicense vcfLicense() { + VcfLicenseInner inner = this.innerModel().vcfLicense(); + if (inner != null) { + return new VcfLicenseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateCloudPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java index afaa7b4ed336..888768df9d13 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java @@ -32,11 +32,13 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.fluent.models.VcfLicenseInner; import com.azure.resourcemanager.avs.implementation.models.PrivateCloudList; import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; import java.nio.ByteBuffer; @@ -243,6 +245,26 @@ Response listAdminCredentialsSync(@HostParam("endpoint") @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/getVcfLicense") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVcfLicense(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/getVcfLicense") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getVcfLicenseSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -286,6 +308,18 @@ Response listInSubscriptionNextSync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.getApiVersion(), @@ -321,6 +355,20 @@ private PagedFlux listByResourceGroupAsync(String resourceGro */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); @@ -340,6 +388,20 @@ private PagedResponse listByResourceGroupSinglePage(String re */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); @@ -388,6 +450,14 @@ public PagedIterable listByResourceGroup(String resourceGroup */ @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.")); + } + 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.getApiVersion(), @@ -419,6 +489,16 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -437,6 +517,16 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -484,6 +574,22 @@ public PagedIterable list(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -521,6 +627,24 @@ private Mono getByResourceGroupAsync(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -555,6 +679,27 @@ public PrivateCloudInner getByResourceGroup(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloud == null) { + return Mono.error(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + } else { + privateCloud.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -578,6 +723,30 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloud == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + } else { + privateCloud.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -600,6 +769,30 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloud == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + } else { + privateCloud.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -734,6 +927,28 @@ public PrivateCloudInner createOrUpdate(String resourceGroupName, String private @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloudUpdate == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + } else { + privateCloudUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -757,6 +972,30 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloudUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + } else { + privateCloudUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -779,6 +1018,30 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloudUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + } else { + privateCloudUpdate.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -912,6 +1175,22 @@ public PrivateCloudInner update(String resourceGroupName, String privateCloudNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context)) @@ -930,6 +1209,24 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, Context.NONE); } @@ -948,6 +1245,24 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context); } @@ -1061,6 +1376,22 @@ public void delete(String resourceGroupName, String privateCloudName, Context co @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> rotateVcenterPasswordWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext( context -> service.rotateVcenterPassword(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1080,6 +1411,24 @@ private Mono>> rotateVcenterPasswordWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Response rotateVcenterPasswordWithResponse(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.rotateVcenterPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, Context.NONE); } @@ -1098,6 +1447,24 @@ private Response rotateVcenterPasswordWithResponse(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private Response rotateVcenterPasswordWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.rotateVcenterPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context); } @@ -1214,6 +1581,22 @@ public void rotateVcenterPassword(String resourceGroupName, String privateCloudN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> rotateNsxtPasswordWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.rotateNsxtPassword(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context)) @@ -1232,6 +1615,24 @@ private Mono>> rotateNsxtPasswordWithResponseAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Response rotateNsxtPasswordWithResponse(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.rotateNsxtPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, Context.NONE); } @@ -1250,6 +1651,24 @@ private Response rotateNsxtPasswordWithResponse(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private Response rotateNsxtPasswordWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.rotateNsxtPasswordSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, context); } @@ -1367,6 +1786,22 @@ public void rotateNsxtPassword(String resourceGroupName, String privateCloudName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAdminCredentialsWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listAdminCredentials(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1404,6 +1839,24 @@ private Mono listAdminCredentialsAsync(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) public Response listAdminCredentialsWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return service.listAdminCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -1424,6 +1877,110 @@ public AdminCredentialsInner listAdminCredentials(String resourceGroupName, Stri return listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue(); } + /** + * Get the license for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the license for the private cloud along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVcfLicenseWithResponseAsync(String resourceGroupName, + String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getVcfLicense(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the license for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the license for the private cloud on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVcfLicenseAsync(String resourceGroupName, String privateCloudName) { + return getVcfLicenseWithResponseAsync(resourceGroupName, privateCloudName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the license for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the license for the private cloud along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVcfLicenseWithResponse(String resourceGroupName, String privateCloudName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getVcfLicenseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); + } + + /** + * Get the license for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the license for the private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VcfLicenseInner getVcfLicense(String resourceGroupName, String privateCloudName) { + return getVcfLicenseWithResponse(resourceGroupName, privateCloudName, Context.NONE).getValue(); + } + /** * Get the next page of items. * @@ -1436,6 +1993,13 @@ public AdminCredentialsInner listAdminCredentials(String resourceGroupName, Stri */ @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(), @@ -1454,6 +2018,15 @@ private Mono> listNextSinglePageAsync(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1473,6 +2046,15 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -1491,6 +2073,13 @@ private PagedResponse listNextSinglePage(String nextLink, Con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInSubscriptionNextSinglePageAsync(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( @@ -1511,6 +2100,15 @@ private Mono> listInSubscriptionNextSinglePageA */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listInSubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listInSubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1530,10 +2128,21 @@ private PagedResponse listInSubscriptionNextSinglePage(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listInSubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listInSubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java index b06033b8fb3b..ac55af5aed3f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java @@ -12,9 +12,11 @@ import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.fluent.models.VcfLicenseInner; import com.azure.resourcemanager.avs.models.AdminCredentials; import com.azure.resourcemanager.avs.models.PrivateCloud; import com.azure.resourcemanager.avs.models.PrivateClouds; +import com.azure.resourcemanager.avs.models.VcfLicense; public final class PrivateCloudsImpl implements PrivateClouds { private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudsImpl.class); @@ -114,6 +116,27 @@ public AdminCredentials listAdminCredentials(String resourceGroupName, String pr } } + public Response getVcfLicenseWithResponse(String resourceGroupName, String privateCloudName, + Context context) { + Response inner + = this.serviceClient().getVcfLicenseWithResponse(resourceGroupName, privateCloudName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VcfLicenseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VcfLicense getVcfLicense(String resourceGroupName, String privateCloudName) { + VcfLicenseInner inner = this.serviceClient().getVcfLicense(resourceGroupName, privateCloudName); + if (inner != null) { + return new VcfLicenseImpl(inner, this.manager()); + } else { + return null; + } + } + public PrivateCloud getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java index 3531d1e85933..900748760d18 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ProvisionedNetworksClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.ProvisionedNetworksClient; import com.azure.resourcemanager.avs.fluent.models.ProvisionedNetworkInner; import com.azure.resourcemanager.avs.implementation.models.ProvisionedNetworkListResult; @@ -135,6 +136,22 @@ Response listNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -172,6 +189,24 @@ private PagedFlux listAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -194,6 +229,24 @@ private PagedResponse listSinglePage(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -250,6 +303,26 @@ public PagedIterable list(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String provisionedNetworkName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (provisionedNetworkName == null) { + return Mono.error( + new IllegalArgumentException("Parameter provisionedNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -291,6 +364,28 @@ private Mono getAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String provisionedNetworkName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (provisionedNetworkName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter provisionedNetworkName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, provisionedNetworkName, accept, context); @@ -325,6 +420,13 @@ public ProvisionedNetworkInner get(String resourceGroupName, String privateCloud */ @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(), @@ -343,6 +445,15 @@ private Mono> listNextSinglePageAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -362,10 +473,21 @@ private PagedResponse listNextSinglePage(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(ProvisionedNetworksClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PureStoragePoliciesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PureStoragePoliciesClientImpl.java index 6eb23047b9b7..99b333ed7943 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PureStoragePoliciesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PureStoragePoliciesClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.PureStoragePoliciesClient; @@ -186,6 +187,22 @@ Response listNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -223,6 +240,24 @@ private PagedFlux listAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -245,6 +280,24 @@ private PagedResponse listSinglePage(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -301,6 +354,26 @@ public PagedIterable list(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String storagePolicyName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, storagePolicyName, accept, context)) @@ -340,6 +413,28 @@ private Mono getAsync(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String storagePolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, storagePolicyName, accept, context); @@ -377,6 +472,31 @@ public PureStoragePolicyInner get(String resourceGroupName, String privateCloudN @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String storagePolicyName, PureStoragePolicyInner resource) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -401,6 +521,34 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String storagePolicyName, PureStoragePolicyInner resource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -424,6 +572,34 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String storagePolicyName, PureStoragePolicyInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -572,6 +748,26 @@ public PureStoragePolicyInner createOrUpdate(String resourceGroupName, String pr @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String storagePolicyName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, storagePolicyName, context)) @@ -592,6 +788,28 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String storagePolicyName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, storagePolicyName, Context.NONE); } @@ -611,6 +829,28 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String storagePolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (storagePolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storagePolicyName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, storagePolicyName, context); } @@ -733,6 +973,13 @@ public void delete(String resourceGroupName, String privateCloudName, String sto */ @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(), @@ -751,6 +998,15 @@ private Mono> listNextSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -770,10 +1026,21 @@ private PagedResponse listNextSinglePage(String nextLink */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(PureStoragePoliciesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java index ebbe53bbfe61..af0b498e1866 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptCmdletsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.ScriptCmdletsClient; import com.azure.resourcemanager.avs.fluent.models.ScriptCmdletInner; import com.azure.resourcemanager.avs.implementation.models.ScriptCmdletsList; @@ -138,6 +139,26 @@ Response listNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, String scriptPackageName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptPackageName, accept, context)) @@ -178,6 +199,28 @@ private PagedFlux listAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String scriptPackageName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), @@ -201,6 +244,28 @@ private PagedResponse listSinglePage(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptPackageName, accept, context); @@ -261,6 +326,30 @@ public PagedIterable list(String resourceGroupName, String pr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + if (scriptCmdletName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptCmdletName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -304,6 +393,32 @@ private Mono getAsync(String resourceGroupName, String privat @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String scriptPackageName, String scriptCmdletName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } + if (scriptCmdletName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptCmdletName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptPackageName, scriptCmdletName, accept, context); @@ -340,6 +455,13 @@ public ScriptCmdletInner get(String resourceGroupName, String privateCloudName, */ @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(), @@ -358,6 +480,15 @@ private Mono> listNextSinglePageAsync(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -377,9 +508,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptCmdletsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java index 96126707e333..53339ae896ed 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptExecutionsClientImpl.java @@ -31,6 +31,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.ScriptExecutionsClient; @@ -209,6 +210,22 @@ Response listNextSync(@PathParam(value = "nextLink", encod @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -246,6 +263,24 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -267,6 +302,24 @@ private PagedResponse listSinglePage(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -322,6 +375,26 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, context)) @@ -361,6 +434,28 @@ private Mono getAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, context); @@ -398,6 +493,32 @@ public ScriptExecutionInner get(String resourceGroupName, String privateCloudNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + if (scriptExecution == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + } else { + scriptExecution.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -422,6 +543,34 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + if (scriptExecution == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + } else { + scriptExecution.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -445,6 +594,34 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, ScriptExecutionInner scriptExecution, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } + if (scriptExecution == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecution is required and cannot be null.")); + } else { + scriptExecution.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -592,6 +769,26 @@ public ScriptExecutionInner createOrUpdate(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, context)) @@ -612,6 +809,28 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, Context.NONE); } @@ -631,6 +850,28 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, context); } @@ -758,6 +999,26 @@ public void delete(String resourceGroupName, String privateCloudName, String scr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getExecutionLogsWithResponseAsync(String resourceGroupName, String privateCloudName, String scriptExecutionName, List scriptOutputStreamType) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getExecutionLogs(this.client.getEndpoint(), this.client.getApiVersion(), @@ -803,6 +1064,28 @@ private Mono getExecutionLogsAsync(String resourceGroupNam public Response getExecutionLogsWithResponse(String resourceGroupName, String privateCloudName, String scriptExecutionName, List scriptOutputStreamType, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptExecutionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptExecutionName is required and cannot be null.")); + } final String accept = "application/json"; return service.getExecutionLogsSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptExecutionName, accept, @@ -840,6 +1123,13 @@ public ScriptExecutionInner getExecutionLogs(String resourceGroupName, String pr */ @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(), @@ -858,6 +1148,15 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -877,9 +1176,20 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptExecutionsClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java index b33281f0304d..616e406ca7f4 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ScriptPackagesClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.ScriptPackagesClient; import com.azure.resourcemanager.avs.fluent.models.ScriptPackageInner; import com.azure.resourcemanager.avs.implementation.models.ScriptPackagesList; @@ -133,6 +134,22 @@ Response listNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -170,6 +187,24 @@ private PagedFlux listAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -191,6 +226,24 @@ private PagedResponse listSinglePage(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -245,6 +298,26 @@ public PagedIterable list(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String scriptPackageName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptPackageName, accept, context)) @@ -284,6 +357,28 @@ private Mono getAsync(String resourceGroupName, String priva @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String scriptPackageName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (scriptPackageName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scriptPackageName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, scriptPackageName, accept, context); @@ -317,6 +412,13 @@ public ScriptPackageInner get(String resourceGroupName, String privateCloudName, */ @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(), @@ -335,6 +437,15 @@ private Mono> listNextSinglePageAsync(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -354,9 +465,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptPackagesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java index e37fdda661c6..0246dbb18ea8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/SkusClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.avs.fluent.SkusClient; import com.azure.resourcemanager.avs.fluent.models.ResourceSkuInner; import com.azure.resourcemanager.avs.implementation.models.PagedResourceSku; @@ -101,6 +102,14 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = */ @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.")); + } + 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.getApiVersion(), @@ -131,6 +140,16 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -149,6 +168,16 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -194,6 +223,13 @@ public PagedIterable list(Context context) { */ @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(), @@ -212,6 +248,15 @@ private Mono> listNextSinglePageAsync(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -231,9 +276,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(SkusClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VcfLicenseImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VcfLicenseImpl.java new file mode 100644 index 000000000000..afc5b63d63b1 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VcfLicenseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.VcfLicenseInner; +import com.azure.resourcemanager.avs.models.LicenseProvisioningState; +import com.azure.resourcemanager.avs.models.VcfLicense; +import com.azure.resourcemanager.avs.models.VcfLicenseKind; + +public final class VcfLicenseImpl implements VcfLicense { + private VcfLicenseInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + VcfLicenseImpl(VcfLicenseInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public VcfLicenseKind kind() { + return this.innerModel().kind(); + } + + public LicenseProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public VcfLicenseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java index 0733208c4972..89babbfa502f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/VirtualMachinesClientImpl.java @@ -29,6 +29,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.VirtualMachinesClient; @@ -165,6 +166,25 @@ Response listNextSync(@PathParam(value = "nextLink", encode @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName, String clusterName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -206,6 +226,28 @@ private PagedFlux listAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, Context.NONE); @@ -228,6 +270,28 @@ private PagedResponse listSinglePage(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, accept, context); @@ -287,6 +351,29 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -330,6 +417,32 @@ private Mono getAsync(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, virtualMachineId, accept, context); @@ -371,6 +484,35 @@ public VirtualMachineInner get(String resourceGroupName, String privateCloudName private Mono>> restrictMovementWithResponseAsync(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + if (restrictMovement == null) { + return Mono + .error(new IllegalArgumentException("Parameter restrictMovement is required and cannot be null.")); + } else { + restrictMovement.validate(); + } final String contentType = "application/json"; return FluxUtil .withContext(context -> service.restrictMovement(this.client.getEndpoint(), this.client.getApiVersion(), @@ -395,6 +537,38 @@ private Mono>> restrictMovementWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) private Response restrictMovementWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + if (restrictMovement == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter restrictMovement is required and cannot be null.")); + } else { + restrictMovement.validate(); + } final String contentType = "application/json"; return service.restrictMovementSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, virtualMachineId, @@ -418,6 +592,38 @@ private Response restrictMovementWithResponse(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Response restrictMovementWithResponse(String resourceGroupName, String privateCloudName, String clusterName, String virtualMachineId, VirtualMachineRestrictMovement restrictMovement, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + if (restrictMovement == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter restrictMovement is required and cannot be null.")); + } else { + restrictMovement.validate(); + } final String contentType = "application/json"; return service.restrictMovementSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, clusterName, virtualMachineId, @@ -561,6 +767,13 @@ public void restrictMovement(String resourceGroupName, String privateCloudName, */ @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(), @@ -579,6 +792,15 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -598,9 +820,20 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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); } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java index 574e18c47046..b8d335041b31 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java @@ -31,6 +31,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; @@ -1066,6 +1067,22 @@ Response listVMGroupsNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1103,6 +1120,24 @@ private Mono getAsync(String resourceGroupName, String pri @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -1137,6 +1172,22 @@ public WorkloadNetworkInner get(String resourceGroupName, String privateCloudNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1174,6 +1225,24 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, Context.NONE); @@ -1195,6 +1264,24 @@ private PagedResponse listSinglePage(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, accept, context); @@ -1250,6 +1337,22 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDhcpSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDhcp(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1288,6 +1391,24 @@ private PagedFlux listDhcpAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDhcpSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1310,6 +1431,24 @@ private PagedResponse listDhcpSinglePage(String resour @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDhcpSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1366,6 +1505,25 @@ public PagedIterable listDhcp(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDhcpWithResponseAsync(String resourceGroupName, String dhcpId, String privateCloudName) { + 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.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDhcp(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1406,6 +1564,28 @@ private Mono getDhcpAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getDhcpWithResponse(String resourceGroupName, String dhcpId, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return service.getDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dhcpId, privateCloudName, accept, context); @@ -1442,6 +1622,31 @@ public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createDhcpWithResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -1466,6 +1671,34 @@ private Mono>> createDhcpWithResponseAsync(String reso @ServiceMethod(returns = ReturnType.SINGLE) private Response createDhcpWithResponse(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1489,6 +1722,34 @@ private Response createDhcpWithResponse(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Response createDhcpWithResponse(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1636,6 +1897,31 @@ public WorkloadNetworkDhcpInner createDhcp(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateDhcpWithResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -1660,6 +1946,34 @@ private Mono>> updateDhcpWithResponseAsync(String reso @ServiceMethod(returns = ReturnType.SINGLE) private Response updateDhcpWithResponse(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1683,6 +1997,34 @@ private Response updateDhcpWithResponse(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Response updateDhcpWithResponse(String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1829,6 +2171,25 @@ public WorkloadNetworkDhcpInner updateDhcp(String resourceGroupName, String priv @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteDhcpWithResponseAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deleteDhcp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, context)) @@ -1849,6 +2210,28 @@ private Mono>> deleteDhcpWithResponseAsync(String reso @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteDhcpWithResponse(String resourceGroupName, String privateCloudName, String dhcpId) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } return service.deleteDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, Context.NONE); } @@ -1868,6 +2251,28 @@ private Response deleteDhcpWithResponse(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteDhcpWithResponse(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } return service.deleteDhcpSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dhcpId, context); } @@ -1991,6 +2396,22 @@ public void deleteDhcp(String resourceGroupName, String privateCloudName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDnsServicesSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDnsServices(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2030,6 +2451,24 @@ private PagedFlux listDnsServicesAsync(String re @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsServicesSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsServicesSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2052,6 +2491,24 @@ private PagedResponse listDnsServicesSinglePage( @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsServicesSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsServicesSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2111,6 +2568,25 @@ public PagedIterable listDnsServices(String reso @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDnsServiceWithResponseAsync(String resourceGroupName, String privateCloudName, String dnsServiceId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDnsService(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2151,6 +2627,28 @@ private Mono getDnsServiceAsync(String resourceG @ServiceMethod(returns = ReturnType.SINGLE) public Response getDnsServiceWithResponse(String resourceGroupName, String privateCloudName, String dnsServiceId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } final String accept = "application/json"; return service.getDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsServiceId, accept, context); @@ -2188,6 +2686,31 @@ public WorkloadNetworkDnsServiceInner getDnsService(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createDnsServiceWithResponseAsync(String resourceGroupName, String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -2212,6 +2735,35 @@ private Mono>> createDnsServiceWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) private Response createDnsServiceWithResponse(String resourceGroupName, String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2235,6 +2787,35 @@ private Response createDnsServiceWithResponse(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Response createDnsServiceWithResponse(String resourceGroupName, String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2384,6 +2965,31 @@ public WorkloadNetworkDnsServiceInner createDnsService(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateDnsServiceWithResponseAsync(String resourceGroupName, String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -2408,6 +3014,35 @@ private Mono>> updateDnsServiceWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) private Response updateDnsServiceWithResponse(String resourceGroupName, String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2431,6 +3066,35 @@ private Response updateDnsServiceWithResponse(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Response updateDnsServiceWithResponse(String resourceGroupName, String privateCloudName, String dnsServiceId, WorkloadNetworkDnsServiceInner workloadNetworkDnsService, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2579,6 +3243,25 @@ public WorkloadNetworkDnsServiceInner updateDnsService(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteDnsServiceWithResponseAsync(String resourceGroupName, String dnsServiceId, String privateCloudName) { + 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.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deleteDnsService(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, context)) @@ -2599,6 +3282,28 @@ private Mono>> deleteDnsServiceWithResponseAsync(Strin @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteDnsServiceWithResponse(String resourceGroupName, String dnsServiceId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, Context.NONE); } @@ -2618,6 +3323,28 @@ private Response deleteDnsServiceWithResponse(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteDnsServiceWithResponse(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsServiceId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteDnsServiceSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dnsServiceId, privateCloudName, context); } @@ -2743,6 +3470,22 @@ public void deleteDnsService(String resourceGroupName, String dnsServiceId, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDnsZonesSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDnsZones(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2782,6 +3525,24 @@ private PagedFlux listDnsZonesAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsZonesSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsZonesSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2804,6 +3565,24 @@ private PagedResponse listDnsZonesSinglePage(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsZonesSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsZonesSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2860,6 +3639,25 @@ public PagedIterable listDnsZones(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDnsZoneWithResponseAsync(String resourceGroupName, String privateCloudName, String dnsZoneId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2900,6 +3698,28 @@ private Mono getDnsZoneAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getDnsZoneWithResponse(String resourceGroupName, String privateCloudName, String dnsZoneId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } final String accept = "application/json"; return service.getDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, dnsZoneId, accept, context); @@ -2936,6 +3756,31 @@ public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createDnsZoneWithResponseAsync(String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -2960,6 +3805,34 @@ private Mono>> createDnsZoneWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response createDnsZoneWithResponse(String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -2983,6 +3856,34 @@ private Response createDnsZoneWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response createDnsZoneWithResponse(String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3131,6 +4032,31 @@ public WorkloadNetworkDnsZoneInner createDnsZone(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateDnsZoneWithResponseAsync(String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -3155,6 +4081,34 @@ private Mono>> updateDnsZoneWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response updateDnsZoneWithResponse(String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3178,6 +4132,34 @@ private Response updateDnsZoneWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response updateDnsZoneWithResponse(String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3325,6 +4307,25 @@ public WorkloadNetworkDnsZoneInner updateDnsZone(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteDnsZoneWithResponseAsync(String resourceGroupName, String dnsZoneId, String privateCloudName) { + 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.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deleteDnsZone(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, context)) @@ -3345,6 +4346,28 @@ private Mono>> deleteDnsZoneWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteDnsZoneWithResponse(String resourceGroupName, String dnsZoneId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, Context.NONE); } @@ -3364,6 +4387,28 @@ private Response deleteDnsZoneWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteDnsZoneWithResponse(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsZoneId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteDnsZoneSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, dnsZoneId, privateCloudName, context); } @@ -3488,6 +4533,22 @@ public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String pri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listGatewaysSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listGateways(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3527,6 +4588,24 @@ private PagedFlux listGatewaysAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listGatewaysSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listGatewaysSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3549,6 +4628,24 @@ private PagedResponse listGatewaysSinglePage(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listGatewaysSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listGatewaysSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3605,6 +4702,25 @@ public PagedIterable listGateways(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getGatewayWithResponseAsync(String resourceGroupName, String privateCloudName, String gatewayId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getGateway(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3645,6 +4761,28 @@ private Mono getGatewayAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getGatewayWithResponse(String resourceGroupName, String privateCloudName, String gatewayId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (gatewayId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } final String accept = "application/json"; return service.getGatewaySync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, gatewayId, accept, context); @@ -3680,6 +4818,22 @@ public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPortMirroringSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3720,6 +4874,24 @@ private PagedFlux listPortMirroringAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPortMirroringSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3742,6 +4914,24 @@ private PagedResponse listPortMirroringSingle @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPortMirroringSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3801,6 +4991,26 @@ public PagedIterable listPortMirroring(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getPortMirroringWithResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getPortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3841,6 +5051,28 @@ private Mono getPortMirroringAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) public Response getPortMirroringWithResponse(String resourceGroupName, String privateCloudName, String portMirroringId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } final String accept = "application/json"; return service.getPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, portMirroringId, accept, context); @@ -3880,6 +5112,32 @@ public WorkloadNetworkPortMirroringInner getPortMirroring(String resourceGroupNa private Mono>> createPortMirroringWithResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -3904,6 +5162,35 @@ private Mono>> createPortMirroringWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) private Response createPortMirroringWithResponse(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -3927,6 +5214,35 @@ private Response createPortMirroringWithResponse(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private Response createPortMirroringWithResponse(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createPortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4077,6 +5393,32 @@ public WorkloadNetworkPortMirroringInner createPortMirroring(String resourceGrou private Mono>> updatePortMirroringWithResponseAsync(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -4101,6 +5443,35 @@ private Mono>> updatePortMirroringWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) private Response updatePortMirroringWithResponse(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updatePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4124,6 +5495,35 @@ private Response updatePortMirroringWithResponse(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private Response updatePortMirroringWithResponse(String resourceGroupName, String privateCloudName, String portMirroringId, WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updatePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4272,6 +5672,26 @@ public WorkloadNetworkPortMirroringInner updatePortMirroring(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deletePortMirroringWithResponseAsync(String resourceGroupName, String portMirroringId, String privateCloudName) { + 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.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deletePortMirroring(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, context)) @@ -4292,6 +5712,28 @@ private Mono>> deletePortMirroringWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) private Response deletePortMirroringWithResponse(String resourceGroupName, String portMirroringId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deletePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, Context.NONE); } @@ -4311,6 +5753,28 @@ private Response deletePortMirroringWithResponse(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) private Response deletePortMirroringWithResponse(String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (portMirroringId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deletePortMirroringSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, portMirroringId, privateCloudName, context); } @@ -4438,6 +5902,22 @@ public void deletePortMirroring(String resourceGroupName, String portMirroringId @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPublicIPsSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listPublicIPs(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4477,6 +5957,24 @@ private PagedFlux listPublicIPsAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPublicIPsSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPublicIPsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4499,6 +5997,24 @@ private PagedResponse listPublicIPsSinglePage(Stri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPublicIPsSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPublicIPsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4558,6 +6074,25 @@ public PagedIterable listPublicIPs(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getPublicIpWithResponseAsync(String resourceGroupName, String privateCloudName, String publicIPId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIPId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getPublicIp(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4598,6 +6133,28 @@ private Mono getPublicIpAsync(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) public Response getPublicIpWithResponse(String resourceGroupName, String privateCloudName, String publicIPId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } final String accept = "application/json"; return service.getPublicIpSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, publicIPId, accept, context); @@ -4635,6 +6192,31 @@ public WorkloadNetworkPublicIpInner getPublicIp(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createPublicIpWithResponseAsync(String resourceGroupName, String privateCloudName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIPId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + if (workloadNetworkPublicIp == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + } else { + workloadNetworkPublicIp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -4659,6 +6241,34 @@ private Mono>> createPublicIpWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createPublicIpWithResponse(String resourceGroupName, String privateCloudName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + if (workloadNetworkPublicIp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + } else { + workloadNetworkPublicIp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createPublicIpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4682,6 +6292,34 @@ private Response createPublicIpWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createPublicIpWithResponse(String resourceGroupName, String privateCloudName, String publicIPId, WorkloadNetworkPublicIpInner workloadNetworkPublicIp, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (publicIPId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIPId is required and cannot be null.")); + } + if (workloadNetworkPublicIp == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkPublicIp is required and cannot be null.")); + } else { + workloadNetworkPublicIp.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createPublicIpSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -4829,6 +6467,25 @@ public WorkloadNetworkPublicIpInner createPublicIp(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deletePublicIpWithResponseAsync(String resourceGroupName, String publicIpId, String privateCloudName) { + 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.")); + } + if (publicIpId == null) { + return Mono.error(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deletePublicIp(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, context)) @@ -4849,6 +6506,28 @@ private Mono>> deletePublicIpWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response deletePublicIpWithResponse(String resourceGroupName, String publicIpId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deletePublicIpSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, Context.NONE); } @@ -4868,6 +6547,28 @@ private Response deletePublicIpWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response deletePublicIpWithResponse(String resourceGroupName, String publicIpId, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (publicIpId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter publicIpId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deletePublicIpSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, publicIpId, privateCloudName, context); } @@ -4992,6 +6693,22 @@ public void deletePublicIp(String resourceGroupName, String publicIpId, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSegmentsSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listSegments(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5031,6 +6748,24 @@ private PagedFlux listSegmentsAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSegmentsSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSegmentsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5053,6 +6788,24 @@ private PagedResponse listSegmentsSinglePage(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSegmentsSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSegmentsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5109,6 +6862,25 @@ public PagedIterable listSegments(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSegmentWithResponseAsync(String resourceGroupName, String privateCloudName, String segmentId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getSegment(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5149,6 +6921,28 @@ private Mono getSegmentAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getSegmentWithResponse(String resourceGroupName, String privateCloudName, String segmentId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } final String accept = "application/json"; return service.getSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, accept, context); @@ -5185,6 +6979,31 @@ public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createSegmentsWithResponseAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -5209,6 +7028,34 @@ private Mono>> createSegmentsWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createSegmentsWithResponse(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createSegmentsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5232,6 +7079,34 @@ private Response createSegmentsWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createSegmentsWithResponse(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createSegmentsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5380,6 +7255,31 @@ public WorkloadNetworkSegmentInner createSegments(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateSegmentsWithResponseAsync(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -5404,6 +7304,34 @@ private Mono>> updateSegmentsWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateSegmentsWithResponse(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSegmentsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5427,6 +7355,34 @@ private Response updateSegmentsWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response updateSegmentsWithResponse(String resourceGroupName, String privateCloudName, String segmentId, WorkloadNetworkSegmentInner workloadNetworkSegment, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateSegmentsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5574,6 +7530,25 @@ public WorkloadNetworkSegmentInner updateSegments(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteSegmentWithResponseAsync(String resourceGroupName, String privateCloudName, String segmentId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deleteSegment(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, context)) @@ -5594,6 +7569,28 @@ private Mono>> deleteSegmentWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteSegmentWithResponse(String resourceGroupName, String privateCloudName, String segmentId) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } return service.deleteSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, Context.NONE); } @@ -5613,6 +7610,28 @@ private Response deleteSegmentWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteSegmentWithResponse(String resourceGroupName, String privateCloudName, String segmentId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } return service.deleteSegmentSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, segmentId, context); } @@ -5737,6 +7756,22 @@ public void deleteSegment(String resourceGroupName, String privateCloudName, Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVirtualMachinesSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listVirtualMachines(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5777,6 +7812,24 @@ private PagedFlux listVirtualMachinesAsync(S @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVirtualMachinesSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVirtualMachinesSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5799,6 +7852,24 @@ private PagedResponse listVirtualMachinesSin @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVirtualMachinesSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVirtualMachinesSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5858,6 +7929,26 @@ public PagedIterable listVirtualMachines(Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getVirtualMachineWithResponseAsync(String resourceGroupName, String privateCloudName, String virtualMachineId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getVirtualMachine(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5899,6 +7990,28 @@ private Mono getVirtualMachineAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) public Response getVirtualMachineWithResponse(String resourceGroupName, String privateCloudName, String virtualMachineId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (virtualMachineId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } final String accept = "application/json"; return service.getVirtualMachineSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, virtualMachineId, accept, context); @@ -5936,6 +8049,22 @@ public WorkloadNetworkVirtualMachineInner getVirtualMachine(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVMGroupsSinglePageAsync(String resourceGroupName, String privateCloudName) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listVMGroups(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5975,6 +8104,24 @@ private PagedFlux listVMGroupsAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVMGroupsSinglePage(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVMGroupsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -5997,6 +8144,24 @@ private PagedResponse listVMGroupsSinglePage(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVMGroupsSinglePage(String resourceGroupName, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVMGroupsSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -6053,6 +8218,25 @@ public PagedIterable listVMGroups(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getVMGroupWithResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), @@ -6093,6 +8277,28 @@ private Mono getVMGroupAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getVMGroupWithResponse(String resourceGroupName, String privateCloudName, String vmGroupId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } final String accept = "application/json"; return service.getVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, privateCloudName, vmGroupId, accept, context); @@ -6129,6 +8335,31 @@ public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String p @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createVMGroupWithResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -6153,6 +8384,34 @@ private Mono>> createVMGroupWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response createVMGroupWithResponse(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -6176,6 +8435,34 @@ private Response createVMGroupWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response createVMGroupWithResponse(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.createVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -6324,6 +8611,31 @@ public WorkloadNetworkVMGroupInner createVMGroup(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateVMGroupWithResponseAsync(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + 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.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono.error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil @@ -6348,6 +8660,34 @@ private Mono>> updateVMGroupWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response updateVMGroupWithResponse(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -6371,6 +8711,34 @@ private Response updateVMGroupWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response updateVMGroupWithResponse(String resourceGroupName, String privateCloudName, String vmGroupId, WorkloadNetworkVMGroupInner workloadNetworkVMGroup, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } final String contentType = "application/json"; final String accept = "application/json"; return service.updateVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), @@ -6518,6 +8886,25 @@ public WorkloadNetworkVMGroupInner updateVMGroup(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteVMGroupWithResponseAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + 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.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return FluxUtil .withContext(context -> service.deleteVMGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, context)) @@ -6538,6 +8925,28 @@ private Mono>> deleteVMGroupWithResponseAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteVMGroupWithResponse(String resourceGroupName, String vmGroupId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, Context.NONE); } @@ -6557,6 +8966,28 @@ private Response deleteVMGroupWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteVMGroupWithResponse(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmGroupId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } return service.deleteVMGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vmGroupId, privateCloudName, context); } @@ -6679,6 +9110,13 @@ public void deleteVMGroup(String resourceGroupName, String vmGroupId, String pri */ @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(), @@ -6697,6 +9135,15 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -6716,6 +9163,15 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } 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(), @@ -6734,6 +9190,13 @@ private PagedResponse listNextSinglePage(String nextLink, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDhcpNextSinglePageAsync(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.listDhcpNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -6753,6 +9216,15 @@ private Mono> listDhcpNextSinglePageAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDhcpNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDhcpNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -6772,6 +9244,15 @@ private PagedResponse listDhcpNextSinglePage(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDhcpNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDhcpNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -6791,6 +9272,13 @@ private PagedResponse listDhcpNextSinglePage(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDnsServicesNextSinglePageAsync(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.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -6810,6 +9298,15 @@ private Mono> listDnsServicesNextS */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsServicesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsServicesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -6830,6 +9327,15 @@ private PagedResponse listDnsServicesNextSingleP @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsServicesNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsServicesNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -6849,6 +9355,13 @@ private PagedResponse listDnsServicesNextSingleP */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDnsZonesNextSinglePageAsync(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.listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -6868,6 +9381,15 @@ private Mono> listDnsZonesNextSingleP */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsZonesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsZonesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -6887,6 +9409,15 @@ private PagedResponse listDnsZonesNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDnsZonesNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listDnsZonesNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -6906,6 +9437,13 @@ private PagedResponse listDnsZonesNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listGatewaysNextSinglePageAsync(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.listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -6925,6 +9463,15 @@ private Mono> listGatewaysNextSingleP */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listGatewaysNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listGatewaysNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -6944,6 +9491,15 @@ private PagedResponse listGatewaysNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listGatewaysNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listGatewaysNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -6964,6 +9520,13 @@ private PagedResponse listGatewaysNextSinglePage(St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPortMirroringNextSinglePageAsync(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.listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -6983,6 +9546,15 @@ private PagedResponse listGatewaysNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPortMirroringNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPortMirroringNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -7003,6 +9575,15 @@ private PagedResponse listPortMirroringNextSi @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPortMirroringNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPortMirroringNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -7022,6 +9603,13 @@ private PagedResponse listPortMirroringNextSi */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPublicIPsNextSinglePageAsync(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.listPublicIPsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -7041,6 +9629,15 @@ private Mono> listPublicIPsNextSingl */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPublicIPsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPublicIPsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -7060,6 +9657,15 @@ private PagedResponse listPublicIPsNextSinglePage( */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPublicIPsNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listPublicIPsNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -7079,6 +9685,13 @@ private PagedResponse listPublicIPsNextSinglePage( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSegmentsNextSinglePageAsync(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.listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -7098,6 +9711,15 @@ private Mono> listSegmentsNextSingleP */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSegmentsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSegmentsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -7117,6 +9739,15 @@ private PagedResponse listSegmentsNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSegmentsNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listSegmentsNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -7137,6 +9768,13 @@ private PagedResponse listSegmentsNextSinglePage(St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVirtualMachinesNextSinglePageAsync(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( @@ -7157,6 +9795,15 @@ private PagedResponse listSegmentsNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVirtualMachinesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVirtualMachinesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -7177,6 +9824,15 @@ private PagedResponse listVirtualMachinesNex @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVirtualMachinesNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVirtualMachinesNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -7196,6 +9852,13 @@ private PagedResponse listVirtualMachinesNex */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVMGroupsNextSinglePageAsync(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.listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -7215,6 +9878,15 @@ private Mono> listVMGroupsNextSingleP */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVMGroupsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVMGroupsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -7234,10 +9906,21 @@ private PagedResponse listVMGroupsNextSinglePage(St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVMGroupsNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } final String accept = "application/json"; Response res = service.listVMGroupsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworksClientImpl.class); } diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java index e5d4fb041540..34ae80e952df 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/AddonList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 AddonList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AddonList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java index f84cafee32f8..d2bdeceb5fbc 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/CloudLinkList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 CloudLinkList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CloudLinkList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java index 3a93c1e159c6..c58f69412216 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ClusterList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 ClusterList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java index b5ff6853ccf1..e0878d6f1b61 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/DatastoreList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 DatastoreList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DatastoreList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java index d7c4be8e7963..e88d80801ea5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ExpressRouteAuthorizationList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 ExpressRouteAuthorizationList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteAuthorizationList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java index f746409ca777..b0a04317d7a1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/GlobalReachConnectionList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 GlobalReachConnectionList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GlobalReachConnectionList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java index 8b71c46d2f67..de7232d25a29 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HcxEnterpriseSiteList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 HcxEnterpriseSiteList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HcxEnterpriseSiteList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java index 1a0e9bc2b003..4de1ec2a8217 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/HostListResult.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 HostListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HostListResult.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java index 6a1139d28755..a321ab85959f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/IscsiPathListResult.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 IscsiPathListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IscsiPathListResult.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/LicenseListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/LicenseListResult.java new file mode 100644 index 000000000000..ccf1806db154 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/LicenseListResult.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.avs.implementation.models; + +import com.azure.core.annotation.Immutable; +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.avs.fluent.models.LicenseInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a License list operation. + */ +@Immutable +public final class LicenseListResult implements JsonSerializable { + /* + * The License items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LicenseListResult class. + */ + private LicenseListResult() { + } + + /** + * Get the value property: The License 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; + } + + /** + * 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 LicenseListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LicenseListResult.class); + + /** + * {@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 LicenseListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LicenseListResult 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 LicenseListResult. + */ + public static LicenseListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LicenseListResult deserializedLicenseListResult = new LicenseListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LicenseInner.fromJson(reader1)); + deserializedLicenseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLicenseListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLicenseListResult; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/MaintenanceListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/MaintenanceListResult.java new file mode 100644 index 000000000000..8f3144ebfd1a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/MaintenanceListResult.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.avs.implementation.models; + +import com.azure.core.annotation.Immutable; +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.avs.fluent.models.MaintenanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Maintenance list operation. + */ +@Immutable +public final class MaintenanceListResult implements JsonSerializable { + /* + * The Maintenance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MaintenanceListResult class. + */ + private MaintenanceListResult() { + } + + /** + * Get the value property: The Maintenance 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; + } + + /** + * 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 MaintenanceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MaintenanceListResult.class); + + /** + * {@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 MaintenanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaintenanceListResult 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 MaintenanceListResult. + */ + public static MaintenanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaintenanceListResult deserializedMaintenanceListResult = new MaintenanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> MaintenanceInner.fromJson(reader1)); + deserializedMaintenanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMaintenanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMaintenanceListResult; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java index 7fecb50a5cc3..2b1d16cf79ab 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/OperationListResult.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -53,6 +54,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 OperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java index 4d784a499474..1ccee54075e2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PagedResourceSku.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 PagedResourceSku")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PagedResourceSku.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java index 4b61f64231d0..bc967e4fcaeb 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PlacementPoliciesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 PlacementPoliciesList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PlacementPoliciesList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java index 2d45dc6e7b05..5c2d798b7957 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PrivateCloudList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 PrivateCloudList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateCloudList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java index 4d8c39667a45..7a930e31805f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ProvisionedNetworkListResult.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 ProvisionedNetworkListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProvisionedNetworkListResult.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PureStoragePolicyListResult.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PureStoragePolicyListResult.java index 44aa2e444718..b17344e4a86a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PureStoragePolicyListResult.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/PureStoragePolicyListResult.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 PureStoragePolicyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PureStoragePolicyListResult.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java index 3269ee584120..df760524584c 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptCmdletsList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 ScriptCmdletsList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptCmdletsList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java index 88a20ef1b1f5..221a2d7d4c1b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptExecutionsList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 ScriptExecutionsList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptExecutionsList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java index 6253a059412b..4b6b8b48c29f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/ScriptPackagesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 ScriptPackagesList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptPackagesList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java index 2542bd4d7501..db88c30ef7c8 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/VirtualMachinesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 VirtualMachinesList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachinesList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java index e760a062425f..fef946cd0a77 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDhcpList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkDhcpList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkDhcpList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java index 62f1b8d07787..292d21034031 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsServicesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkDnsServicesList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkDnsServicesList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java index c13f855c4457..930c54561a18 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkDnsZonesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkDnsZonesList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkDnsZonesList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java index 2a84426c5234..770af19950ac 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkGatewayList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkGatewayList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkGatewayList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java index 80dedb42f9a3..655ce3573c94 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,22 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java index cdd49e6afc73..8bee83c796c6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPortMirroringList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkPortMirroringList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkPortMirroringList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java index 014cdb9952c7..79339df90f44 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkPublicIPsList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkPublicIPsList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkPublicIPsList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java index 044226a42529..e066949e7b83 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkSegmentsList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkSegmentsList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkSegmentsList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java index d79fc3d65b73..529bacfa504a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVMGroupsList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkVMGroupsList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkVMGroupsList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java index 05b82dba26d3..573d4ffa5d70 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/models/WorkloadNetworkVirtualMachinesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -52,6 +53,23 @@ public String nextLink() { return this.nextLink; } + /** + * 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 WorkloadNetworkVirtualMachinesList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadNetworkVirtualMachinesList.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java index 56dc5528cdcb..1c6933802089 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonArcProperties.java @@ -61,6 +61,15 @@ public AddonArcProperties withVCenter(String vCenter) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java index 6d4cf362f5c4..091a997c44e1 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonHcxProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.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; @@ -111,6 +112,21 @@ public AddonHcxProperties withUplinkNetwork(String uplinkNetwork) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (offer() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property offer in model AddonHcxProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AddonHcxProperties.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java index a2a1f72c101b..67e3aaa9b2ff 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java @@ -61,6 +61,14 @@ AddonProperties withProvisioningState(AddonProvisioningState provisioningState) return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java index 139081a4be43..2cda7ce07dbf 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java @@ -61,6 +61,15 @@ public AddonSrmProperties withLicenseKey(String licenseKey) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java index 610480f2e170..3e925779a273 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonVrProperties.java @@ -61,6 +61,15 @@ public AddonVrProperties withVrsCount(int vrsCount) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java index 9cb74f83cfd7..3bab7b0d484d 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailabilityProperties.java @@ -97,6 +97,14 @@ public AvailabilityProperties withSecondaryZone(Integer secondaryZone) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailableWindowForMaintenanceWhileRescheduleOperation.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailableWindowForMaintenanceWhileRescheduleOperation.java new file mode 100644 index 000000000000..97a0bb1bd305 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailableWindowForMaintenanceWhileRescheduleOperation.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Time window in which Customer can reschedule maintenance. + */ +@Immutable +public final class AvailableWindowForMaintenanceWhileRescheduleOperation extends RescheduleOperationConstraint { + /* + * The kind of operation + */ + private RescheduleOperationConstraintKind kind + = RescheduleOperationConstraintKind.AVAILABLE_WINDOW_FOR_MAINTENANCE_WHILE_RESCHEDULE_OPERATION; + + /* + * Start date time + */ + private OffsetDateTime startsAt; + + /* + * End date Time + */ + private OffsetDateTime endsAt; + + /** + * Creates an instance of AvailableWindowForMaintenanceWhileRescheduleOperation class. + */ + private AvailableWindowForMaintenanceWhileRescheduleOperation() { + } + + /** + * Get the kind property: The kind of operation. + * + * @return the kind value. + */ + @Override + public RescheduleOperationConstraintKind kind() { + return this.kind; + } + + /** + * Get the startsAt property: Start date time. + * + * @return the startsAt value. + */ + public OffsetDateTime startsAt() { + return this.startsAt; + } + + /** + * Get the endsAt property: End date Time. + * + * @return the endsAt value. + */ + public OffsetDateTime endsAt() { + return this.endsAt; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableWindowForMaintenanceWhileRescheduleOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableWindowForMaintenanceWhileRescheduleOperation 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 AvailableWindowForMaintenanceWhileRescheduleOperation. + */ + public static AvailableWindowForMaintenanceWhileRescheduleOperation fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AvailableWindowForMaintenanceWhileRescheduleOperation deserializedAvailableWindowForMaintenanceWhileRescheduleOperation + = new AvailableWindowForMaintenanceWhileRescheduleOperation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startsAt".equals(fieldName)) { + deserializedAvailableWindowForMaintenanceWhileRescheduleOperation.startsAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endsAt".equals(fieldName)) { + deserializedAvailableWindowForMaintenanceWhileRescheduleOperation.endsAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kind".equals(fieldName)) { + deserializedAvailableWindowForMaintenanceWhileRescheduleOperation.kind + = RescheduleOperationConstraintKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableWindowForMaintenanceWhileRescheduleOperation; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailableWindowForMaintenanceWhileScheduleOperation.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailableWindowForMaintenanceWhileScheduleOperation.java new file mode 100644 index 000000000000..2ff94172cfaa --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AvailableWindowForMaintenanceWhileScheduleOperation.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Time window in which Customer can to schedule maintenance. + */ +@Immutable +public final class AvailableWindowForMaintenanceWhileScheduleOperation extends ScheduleOperationConstraint { + /* + * The kind of operation + */ + private ScheduleOperationConstraintKind kind + = ScheduleOperationConstraintKind.AVAILABLE_WINDOW_FOR_MAINTENANCE_WHILE_SCHEDULE_OPERATION; + + /* + * Start date time + */ + private OffsetDateTime startsAt; + + /* + * End date Time + */ + private OffsetDateTime endsAt; + + /** + * Creates an instance of AvailableWindowForMaintenanceWhileScheduleOperation class. + */ + private AvailableWindowForMaintenanceWhileScheduleOperation() { + } + + /** + * Get the kind property: The kind of operation. + * + * @return the kind value. + */ + @Override + public ScheduleOperationConstraintKind kind() { + return this.kind; + } + + /** + * Get the startsAt property: Start date time. + * + * @return the startsAt value. + */ + public OffsetDateTime startsAt() { + return this.startsAt; + } + + /** + * Get the endsAt property: End date Time. + * + * @return the endsAt value. + */ + public OffsetDateTime endsAt() { + return this.endsAt; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableWindowForMaintenanceWhileScheduleOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableWindowForMaintenanceWhileScheduleOperation 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 AvailableWindowForMaintenanceWhileScheduleOperation. + */ + public static AvailableWindowForMaintenanceWhileScheduleOperation fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AvailableWindowForMaintenanceWhileScheduleOperation deserializedAvailableWindowForMaintenanceWhileScheduleOperation + = new AvailableWindowForMaintenanceWhileScheduleOperation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startsAt".equals(fieldName)) { + deserializedAvailableWindowForMaintenanceWhileScheduleOperation.startsAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endsAt".equals(fieldName)) { + deserializedAvailableWindowForMaintenanceWhileScheduleOperation.endsAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kind".equals(fieldName)) { + deserializedAvailableWindowForMaintenanceWhileScheduleOperation.kind + = ScheduleOperationConstraintKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableWindowForMaintenanceWhileScheduleOperation; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedDatesConstraintCategory.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedDatesConstraintCategory.java new file mode 100644 index 000000000000..22ee82dc905a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedDatesConstraintCategory.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Reason for blocking operation on maintenance. + */ +public final class BlockedDatesConstraintCategory extends ExpandableStringEnum { + /** + * Hi-Priority Event. + */ + public static final BlockedDatesConstraintCategory HI_PRIORITY_EVENT = fromString("HiPriorityEvent"); + + /** + * Quota Exhausted. + */ + public static final BlockedDatesConstraintCategory QUOTA_EXHAUSTED = fromString("QuotaExhausted"); + + /** + * Holidays. + */ + public static final BlockedDatesConstraintCategory HOLIDAY = fromString("Holiday"); + + /** + * Creates a new instance of BlockedDatesConstraintCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BlockedDatesConstraintCategory() { + } + + /** + * Creates or finds a BlockedDatesConstraintCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlockedDatesConstraintCategory. + */ + public static BlockedDatesConstraintCategory fromString(String name) { + return fromString(name, BlockedDatesConstraintCategory.class); + } + + /** + * Gets known BlockedDatesConstraintCategory values. + * + * @return known BlockedDatesConstraintCategory values. + */ + public static Collection values() { + return values(BlockedDatesConstraintCategory.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedDatesConstraintTimeRange.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedDatesConstraintTimeRange.java new file mode 100644 index 000000000000..3ce7ed299e28 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedDatesConstraintTimeRange.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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; + +/** + * Blocked Time range Constraints for maintenance. + */ +@Immutable +public final class BlockedDatesConstraintTimeRange implements JsonSerializable { + /* + * Start date time + */ + private OffsetDateTime startsAt; + + /* + * End date Time + */ + private OffsetDateTime endsAt; + + /* + * Reason category for blocking maintenance reschedule + */ + private String reason; + + /** + * Creates an instance of BlockedDatesConstraintTimeRange class. + */ + private BlockedDatesConstraintTimeRange() { + } + + /** + * Get the startsAt property: Start date time. + * + * @return the startsAt value. + */ + public OffsetDateTime startsAt() { + return this.startsAt; + } + + /** + * Get the endsAt property: End date Time. + * + * @return the endsAt value. + */ + public OffsetDateTime endsAt() { + return this.endsAt; + } + + /** + * Get the reason property: Reason category for blocking maintenance reschedule. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlockedDatesConstraintTimeRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlockedDatesConstraintTimeRange 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 BlockedDatesConstraintTimeRange. + */ + public static BlockedDatesConstraintTimeRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlockedDatesConstraintTimeRange deserializedBlockedDatesConstraintTimeRange + = new BlockedDatesConstraintTimeRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startsAt".equals(fieldName)) { + deserializedBlockedDatesConstraintTimeRange.startsAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endsAt".equals(fieldName)) { + deserializedBlockedDatesConstraintTimeRange.endsAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reason".equals(fieldName)) { + deserializedBlockedDatesConstraintTimeRange.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlockedDatesConstraintTimeRange; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedWhileRescheduleOperation.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedWhileRescheduleOperation.java new file mode 100644 index 000000000000..d6d6b81c6fbe --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedWhileRescheduleOperation.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Time ranges blocked for rescheduling maintenance. + */ +@Immutable +public final class BlockedWhileRescheduleOperation extends RescheduleOperationConstraint { + /* + * The kind of operation + */ + private RescheduleOperationConstraintKind kind + = RescheduleOperationConstraintKind.BLOCKED_WHILE_RESCHEDULE_OPERATION; + + /* + * Category of blocked date + */ + private BlockedDatesConstraintCategory category; + + /* + * Date ranges blocked for schedule + */ + private List timeRanges; + + /** + * Creates an instance of BlockedWhileRescheduleOperation class. + */ + private BlockedWhileRescheduleOperation() { + } + + /** + * Get the kind property: The kind of operation. + * + * @return the kind value. + */ + @Override + public RescheduleOperationConstraintKind kind() { + return this.kind; + } + + /** + * Get the category property: Category of blocked date. + * + * @return the category value. + */ + public BlockedDatesConstraintCategory category() { + return this.category; + } + + /** + * Get the timeRanges property: Date ranges blocked for schedule. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlockedWhileRescheduleOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlockedWhileRescheduleOperation 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 BlockedWhileRescheduleOperation. + */ + public static BlockedWhileRescheduleOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlockedWhileRescheduleOperation deserializedBlockedWhileRescheduleOperation + = new BlockedWhileRescheduleOperation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedBlockedWhileRescheduleOperation.category + = BlockedDatesConstraintCategory.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedBlockedWhileRescheduleOperation.kind + = RescheduleOperationConstraintKind.fromString(reader.getString()); + } else if ("timeRanges".equals(fieldName)) { + List timeRanges + = reader.readArray(reader1 -> BlockedDatesConstraintTimeRange.fromJson(reader1)); + deserializedBlockedWhileRescheduleOperation.timeRanges = timeRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedBlockedWhileRescheduleOperation; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedWhileScheduleOperation.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedWhileScheduleOperation.java new file mode 100644 index 000000000000..0e64bc839bd9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/BlockedWhileScheduleOperation.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Time ranges blocked for scheduling maintenance. + */ +@Immutable +public final class BlockedWhileScheduleOperation extends ScheduleOperationConstraint { + /* + * The kind of operation + */ + private ScheduleOperationConstraintKind kind = ScheduleOperationConstraintKind.BLOCKED_WHILE_SCHEDULE_OPERATION; + + /* + * Category of blocked date + */ + private BlockedDatesConstraintCategory category; + + /* + * Date ranges blocked for schedule + */ + private List timeRanges; + + /** + * Creates an instance of BlockedWhileScheduleOperation class. + */ + private BlockedWhileScheduleOperation() { + } + + /** + * Get the kind property: The kind of operation. + * + * @return the kind value. + */ + @Override + public ScheduleOperationConstraintKind kind() { + return this.kind; + } + + /** + * Get the category property: Category of blocked date. + * + * @return the category value. + */ + public BlockedDatesConstraintCategory category() { + return this.category; + } + + /** + * Get the timeRanges property: Date ranges blocked for schedule. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlockedWhileScheduleOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlockedWhileScheduleOperation 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 BlockedWhileScheduleOperation. + */ + public static BlockedWhileScheduleOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlockedWhileScheduleOperation deserializedBlockedWhileScheduleOperation + = new BlockedWhileScheduleOperation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedBlockedWhileScheduleOperation.category + = BlockedDatesConstraintCategory.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedBlockedWhileScheduleOperation.kind + = ScheduleOperationConstraintKind.fromString(reader.getString()); + } else if ("timeRanges".equals(fieldName)) { + List timeRanges + = reader.readArray(reader1 -> BlockedDatesConstraintTimeRange.fromJson(reader1)); + deserializedBlockedWhileScheduleOperation.timeRanges = timeRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedBlockedWhileScheduleOperation; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java index 24fbe5b8fd2d..42484381f02e 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java @@ -78,6 +78,14 @@ public String expressRoutePrivatePeeringId() { return this.expressRoutePrivatePeeringId; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java index a3c4c661754b..f770db686fd9 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java @@ -109,6 +109,20 @@ public ClusterUpdate withHosts(List hosts) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java index 2ae7778fa285..70605586268b 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterZone.java @@ -51,6 +51,14 @@ public String zone() { return this.zone; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java index a86e0630b395..3036ea8f8890 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.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; @@ -114,6 +115,24 @@ public String path() { return this.path; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property targetId in model DiskPoolVolume")); + } + if (lunName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property lunName in model DiskPoolVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DiskPoolVolume.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java index f12c65ce5b68..ecf6eef6c96a 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ElasticSanVolume.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.avs.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; @@ -47,6 +48,20 @@ public ElasticSanVolume withTargetId(String targetId) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property targetId in model ElasticSanVolume")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanVolume.class); + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java index 277667d5dbfc..2485edf71ae5 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Encryption.java @@ -72,6 +72,17 @@ public Encryption withKeyVaultProperties(EncryptionKeyVaultProperties keyVaultPr return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java index 1d9d9301485d..b6279d7d0007 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/EncryptionKeyVaultProperties.java @@ -139,6 +139,14 @@ public EncryptionVersionType versionType() { return this.versionType; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java index c6a146edf113..1ec6012f38fa 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java @@ -106,6 +106,14 @@ public String hcxCloudManagerIp() { return this.hcxCloudManagerIp; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java index 50055b725b50..09d97501e8a6 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GeneralHostProperties.java @@ -36,6 +36,15 @@ public HostKind kind() { return this.kind; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java index c8255eb1492d..9174337d2d96 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HostProperties.java @@ -186,6 +186,14 @@ HostProperties withFaultDomain(String faultDomain) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java index af726e5fbf9a..e5bcdc6c737f 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java @@ -278,6 +278,14 @@ public IdentitySource withPassword(String password) { return this; } + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + /** * {@inheritDoc} */ diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ImpactedMaintenanceResource.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ImpactedMaintenanceResource.java new file mode 100644 index 000000000000..3d8b87b1a3c8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ImpactedMaintenanceResource.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.avs.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; + +/** + * Details about a resource impacted by a failed check. + */ +@Immutable +public final class ImpactedMaintenanceResource implements JsonSerializable { + /* + * The ID of the impacted resource + */ + private String id; + + /* + * A list of errors associated with the impacted resource + */ + private List errors; + + /** + * Creates an instance of ImpactedMaintenanceResource class. + */ + private ImpactedMaintenanceResource() { + } + + /** + * Get the id property: The ID of the impacted resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the errors property: A list of errors associated with the impacted resource. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImpactedMaintenanceResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImpactedMaintenanceResource 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 ImpactedMaintenanceResource. + */ + public static ImpactedMaintenanceResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImpactedMaintenanceResource deserializedImpactedMaintenanceResource = new ImpactedMaintenanceResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImpactedMaintenanceResource.id = reader.getString(); + } else if ("errors".equals(fieldName)) { + List errors + = reader.readArray(reader1 -> ImpactedMaintenanceResourceError.fromJson(reader1)); + deserializedImpactedMaintenanceResource.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedImpactedMaintenanceResource; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ImpactedMaintenanceResourceError.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ImpactedMaintenanceResourceError.java new file mode 100644 index 000000000000..4375479c2310 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ImpactedMaintenanceResourceError.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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; + +/** + * Details about an error affecting a resource. + */ +@Immutable +public final class ImpactedMaintenanceResourceError implements JsonSerializable { + /* + * The error code + */ + private String errorCode; + + /* + * The name of the error + */ + private String name; + + /* + * Additional details about the error + */ + private String details; + + /* + * Steps to resolve the error + */ + private List resolutionSteps; + + /* + * Indicates whether action is required by the customer + */ + private Boolean actionRequired; + + /** + * Creates an instance of ImpactedMaintenanceResourceError class. + */ + private ImpactedMaintenanceResourceError() { + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the name property: The name of the error. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the details property: Additional details about the error. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Get the resolutionSteps property: Steps to resolve the error. + * + * @return the resolutionSteps value. + */ + public List resolutionSteps() { + return this.resolutionSteps; + } + + /** + * Get the actionRequired property: Indicates whether action is required by the customer. + * + * @return the actionRequired value. + */ + public Boolean actionRequired() { + return this.actionRequired; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImpactedMaintenanceResourceError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImpactedMaintenanceResourceError 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 ImpactedMaintenanceResourceError. + */ + public static ImpactedMaintenanceResourceError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImpactedMaintenanceResourceError deserializedImpactedMaintenanceResourceError + = new ImpactedMaintenanceResourceError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedImpactedMaintenanceResourceError.errorCode = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImpactedMaintenanceResourceError.name = reader.getString(); + } else if ("details".equals(fieldName)) { + deserializedImpactedMaintenanceResourceError.details = reader.getString(); + } else if ("resolutionSteps".equals(fieldName)) { + List resolutionSteps = reader.readArray(reader1 -> reader1.getString()); + deserializedImpactedMaintenanceResourceError.resolutionSteps = resolutionSteps; + } else if ("actionRequired".equals(fieldName)) { + deserializedImpactedMaintenanceResourceError.actionRequired + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedImpactedMaintenanceResourceError; + }); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Label.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Label.java new file mode 100644 index 000000000000..12aad77af7f9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Label.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.avs.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 java.io.IOException; + +/** + * A key-value pair representing a label. + */ +@Fluent +public final class Label implements JsonSerializable