diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/CHANGELOG.md b/sdk/maintenance/azure-resourcemanager-maintenance/CHANGELOG.md index 89596c968687..b072f0b630c6 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/CHANGELOG.md +++ b/sdk/maintenance/azure-resourcemanager-maintenance/CHANGELOG.md @@ -1,14 +1,163 @@ # Release History -## 1.1.0-beta.3 (Unreleased) +## 1.1.0-beta.3 (2025-05-12) -### Features Added +- Azure Resource Manager Maintenance client library for Java. This package contains Microsoft Azure SDK for Maintenance Management SDK. Azure Maintenance Management Client. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.OperationInfo` was removed + +#### `models.ScheduledEvents` was removed + +#### `models.Updates` was removed + +#### `models.MaintenanceConfigurationsForResourceGroups` was removed + +#### `models.PublicMaintenanceConfigurations` was removed + +#### `models.ListMaintenanceConfigurationsResult` was removed + +#### `models.ListApplyUpdate` was removed + +#### `models.OperationsListResult` was removed + +#### `models.ConfigurationAssignmentsWithinSubscriptions` was removed + +#### `models.ApplyUpdateForResourceGroups` was removed + +#### `models.ListConfigurationAssignmentsResult` was removed + +#### `models.ListUpdatesResult` was removed + +#### `models.MaintenanceConfigurations` was modified + +* `define(java.lang.String)` was removed +* `getByResourceGroup(java.lang.String,java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByResourceGroup(java.lang.String,java.lang.String)` was removed +* `getByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getById(java.lang.String)` was removed +* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.ConfigurationAssignments` was modified + +* `delete(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `deleteWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `get(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ConfigurationAssignmentInner)` was removed +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ConfigurationAssignmentInner,com.azure.core.util.Context)` was removed +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.Operation` was modified + +* `java.lang.String origin()` -> `models.Origin origin()` +* `properties()` was removed +* `models.OperationInfo display()` -> `models.OperationDisplay display()` + +#### `models.Update` was modified + +* `resourceId()` was removed + +#### `MaintenanceManager` was modified + +* `maintenanceConfigurationsForResourceGroups()` was removed +* `publicMaintenanceConfigurations()` was removed +* `configurationAssignmentsWithinSubscriptions()` was removed +* `fluent.MaintenanceManagementClient serviceClient()` -> `fluent.MaintenanceClient serviceClient()` +* `applyUpdateForResourceGroups()` was removed +* `updates()` was removed +* `scheduledEvents()` was removed + +#### `models.ApplyUpdates` was modified + +* `createOrUpdateParentWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `createOrUpdateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `getWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `createOrUpdateOrCancel(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ApplyUpdateInner)` was removed +* `list()` was removed +* `createOrUpdateParent(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `get(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `createOrUpdateOrCancelWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ApplyUpdateInner,com.azure.core.util.Context)` was removed +* `list(com.azure.core.util.Context)` was removed + +### Features Added + +* `models.ApplyUpdatesOperationGroups` was added + +* `models.ApplyUpdatesOperationGroupsCreateOrUpdateHeaders` was added + +* `models.MaintenanceConfigurationOperationGroups` was added + +* `implementation.models.ListUpdatesResult` was added + +* `models.ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders` was added + +* `models.OperationDisplay` was added + +* `models.ApplyUpdateOperationGroups` was added + +* `models.UpdatesOperationGroups` was added + +* `models.ActionType` was added + +* `implementation.models.ListMaintenanceConfigurationsResult` was added + +* `implementation.models.ListConfigurationAssignmentsResult` was added + +* `models.ConfigurationAssignmentOperationGroups` was added + +* `implementation.models.OperationsListResult` was added + +* `models.ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse` was added + +* `models.UpdateProperties` was added + +* `models.ApplyUpdatesOperationGroupsCreateOrUpdateResponse` was added + +* `models.ScheduledEventOperationGroups` was added + +* `models.ApplyUpdateForResourceGroupOperationGroups` was added + +* `models.ConfigurationAssignmentForResourceGroupOperationGroups` was added + +* `implementation.models.ListApplyUpdate` was added + +* `models.Origin` was added + +#### `models.MaintenanceConfigurations` was modified + +* `getWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `get(java.lang.String)` was added + +#### `models.Operation` was modified + +* `actionType()` was added + +#### `models.Update` was modified + +* `properties()` was added + +#### `models.ConfigurationAssignmentsForSubscriptions` was modified + +* `list()` was added +* `list(com.azure.core.util.Context)` was added + +#### `MaintenanceManager` was modified -### Other Changes +* `applyUpdateOperationGroups()` was added +* `applyUpdateForResourceGroupOperationGroups()` was added +* `updatesOperationGroups()` was added +* `scheduledEventOperationGroups()` was added +* `configurationAssignmentForResourceGroupOperationGroups()` was added +* `configurationAssignmentOperationGroups()` was added +* `maintenanceConfigurationOperationGroups()` was added +* `applyUpdatesOperationGroups()` was added ## 1.1.0-beta.2 (2024-12-04) diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/README.md b/sdk/maintenance/azure-resourcemanager-maintenance/README.md index e95fad2f714e..e009b660eead 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/README.md +++ b/sdk/maintenance/azure-resourcemanager-maintenance/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Maintenance client library for Java. -This package contains Microsoft Azure SDK for Maintenance Management SDK. Azure Maintenance Management Client. Package tag package-preview-2023-10. 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 Maintenance Management SDK. Azure Maintenance Management Client. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ MaintenanceManager manager = MaintenanceManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/SAMPLE.md b/sdk/maintenance/azure-resourcemanager-maintenance/SAMPLE.md index c95aaca745d0..cd50de8b6961 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/SAMPLE.md +++ b/sdk/maintenance/azure-resourcemanager-maintenance/SAMPLE.md @@ -1,28 +1,40 @@ # Code snippets and samples -## ApplyUpdateForResourceGroup +## ApplyUpdateForResourceGroupOperationGroup -- [ListByResourceGroup](#applyupdateforresourcegroup_listbyresourcegroup) +- [ListByResourceGroup](#applyupdateforresourcegroupoperationgroup_listbyresourcegroup) + +## ApplyUpdateOperationGroup + +- [CreateOrUpdateOrCancel](#applyupdateoperationgroup_createorupdateorcancel) +- [Get](#applyupdateoperationgroup_get) +- [List](#applyupdateoperationgroup_list) ## ApplyUpdates -- [CreateOrUpdate](#applyupdates_createorupdate) -- [CreateOrUpdateOrCancel](#applyupdates_createorupdateorcancel) -- [CreateOrUpdateParent](#applyupdates_createorupdateparent) -- [Get](#applyupdates_get) - [GetParent](#applyupdates_getparent) -- [List](#applyupdates_list) + +## ApplyUpdatesOperationGroup + +- [CreateOrUpdate](#applyupdatesoperationgroup_createorupdate) +- [CreateOrUpdateParent](#applyupdatesoperationgroup_createorupdateparent) + +## ConfigurationAssignmentForResourceGroupOperationGroup + +- [List](#configurationassignmentforresourcegroupoperationgroup_list) + +## ConfigurationAssignmentOperationGroup + +- [CreateOrUpdate](#configurationassignmentoperationgroup_createorupdate) +- [Delete](#configurationassignmentoperationgroup_delete) +- [Get](#configurationassignmentoperationgroup_get) ## ConfigurationAssignments -- [CreateOrUpdate](#configurationassignments_createorupdate) - [CreateOrUpdateParent](#configurationassignments_createorupdateparent) -- [Delete](#configurationassignments_delete) - [DeleteParent](#configurationassignments_deleteparent) -- [Get](#configurationassignments_get) - [GetParent](#configurationassignments_getparent) -- [List](#configurationassignments_list) - [ListParent](#configurationassignments_listparent) ## ConfigurationAssignmentsForResourceGroup @@ -37,183 +49,165 @@ - [CreateOrUpdate](#configurationassignmentsforsubscriptions_createorupdate) - [Delete](#configurationassignmentsforsubscriptions_delete) - [Get](#configurationassignmentsforsubscriptions_get) +- [List](#configurationassignmentsforsubscriptions_list) - [Update](#configurationassignmentsforsubscriptions_update) -## ConfigurationAssignmentsWithinSubscription +## MaintenanceConfigurationOperationGroup -- [List](#configurationassignmentswithinsubscription_list) +- [CreateOrUpdate](#maintenanceconfigurationoperationgroup_createorupdate) +- [Delete](#maintenanceconfigurationoperationgroup_delete) +- [GetByResourceGroup](#maintenanceconfigurationoperationgroup_getbyresourcegroup) +- [List](#maintenanceconfigurationoperationgroup_list) +- [ListByResourceGroup](#maintenanceconfigurationoperationgroup_listbyresourcegroup) +- [Update](#maintenanceconfigurationoperationgroup_update) ## MaintenanceConfigurations -- [CreateOrUpdate](#maintenanceconfigurations_createorupdate) -- [Delete](#maintenanceconfigurations_delete) -- [GetByResourceGroup](#maintenanceconfigurations_getbyresourcegroup) +- [Get](#maintenanceconfigurations_get) - [List](#maintenanceconfigurations_list) -- [Update](#maintenanceconfigurations_update) - -## MaintenanceConfigurationsForResourceGroup - -- [ListByResourceGroup](#maintenanceconfigurationsforresourcegroup_listbyresourcegroup) ## Operations - [List](#operations_list) -## PublicMaintenanceConfigurations - -- [Get](#publicmaintenanceconfigurations_get) -- [List](#publicmaintenanceconfigurations_list) - -## ScheduledEvent +## ScheduledEventOperationGroup -- [Acknowledge](#scheduledevent_acknowledge) +- [Acknowledge](#scheduledeventoperationgroup_acknowledge) -## Updates +## UpdatesOperationGroup -- [List](#updates_list) -- [ListParent](#updates_listparent) -### ApplyUpdateForResourceGroup_ListByResourceGroup +- [List](#updatesoperationgroup_list) +- [ListParent](#updatesoperationgroup_listparent) +### ApplyUpdateForResourceGroupOperationGroup_ListByResourceGroup ```java /** - * Samples for ApplyUpdateForResourceGroup ListByResourceGroup. + * Samples for ApplyUpdates GetParent. */ -public final class ApplyUpdateForResourceGroupListByResourceGroupSamples { +public final class ApplyUpdatesGetParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdatesResourceGroup_List.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_GetParent.json */ /** - * Sample code: ApplyUpdatesResourceGroup_List. + * Sample code: ApplyUpdates_GetParent. * * @param manager Entry point to MaintenanceManager. */ - public static void applyUpdatesResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdateForResourceGroups().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); + public static void applyUpdatesGetParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdates() + .getParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "virtualMachines", "smdvm1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", com.azure.core.util.Context.NONE); } } ``` -### ApplyUpdates_CreateOrUpdate +### ApplyUpdateOperationGroup_CreateOrUpdateOrCancel ```java /** - * Samples for ApplyUpdates CreateOrUpdate. + * Samples for ConfigurationAssignments GetParent. */ -public final class ApplyUpdatesCreateOrUpdateSamples { +public final class ConfigurationAssignmentsGetParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_GetParent.json */ /** - * Sample code: ApplyUpdates_CreateOrUpdate. + * Sample code: ConfigurationAssignments_GetParent. * * @param manager Entry point to MaintenanceManager. */ - public static void applyUpdatesCreateOrUpdate(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() - .createOrUpdateWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - com.azure.core.util.Context.NONE); + public static void + configurationAssignmentsGetParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignments() + .getParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "virtualMachines", "smdvm1", "workervmPolicy", com.azure.core.util.Context.NONE); } } ``` -### ApplyUpdates_CreateOrUpdateOrCancel +### ApplyUpdateOperationGroup_Get ```java -import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; -import com.azure.resourcemanager.maintenance.models.UpdateStatus; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; /** - * Samples for ApplyUpdates CreateOrUpdateOrCancel. + * Samples for ConfigurationAssignmentOperationGroup CreateOrUpdate. */ -public final class ApplyUpdatesCreateOrUpdateOrCancelSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdateOnly_NoCancellation.json - */ - /** - * Sample code: ApplyUpdates_CreateOrUpdateOnly_NoCancellation. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void - applyUpdatesCreateOrUpdateOnlyNoCancellation(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() - .createOrUpdateOrCancelWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "20230901121200", new ApplyUpdateInner(), com.azure.core.util.Context.NONE); - } - +public final class ConfigurationAssignmentOperationGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdate_CancelMaintenance.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_CreateOrUpdate.json */ /** - * Sample code: ApplyUpdates_CreateOrUpdateOrCancel. + * Sample code: ConfigurationAssignments_CreateOrUpdate. * * @param manager Entry point to MaintenanceManager. */ public static void - applyUpdatesCreateOrUpdateOrCancel(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() - .createOrUpdateOrCancelWithResponse("examplerg", "Microsoft.Maintenance", "maintenanceConfigurations", - "maintenanceConfig1", "20230901121200", new ApplyUpdateInner().withStatus(UpdateStatus.CANCEL), + configurationAssignmentsCreateOrUpdate(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentOperationGroups() + .createOrUpdateWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "workervmConfiguration", + new ConfigurationAssignmentInner().withMaintenanceConfigurationId( + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), com.azure.core.util.Context.NONE); } } ``` -### ApplyUpdates_CreateOrUpdateParent +### ApplyUpdateOperationGroup_List ```java +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ApplyUpdates CreateOrUpdateParent. + * Samples for ConfigurationAssignmentsForSubscriptions Update. */ -public final class ApplyUpdatesCreateOrUpdateParentSamples { +public final class ConfigurationAssignmentsForSubscriptionsUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdateParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_UpdateForResource.json */ /** - * Sample code: ApplyUpdates_CreateOrUpdateParent. + * Sample code: ConfigurationAssignmentsForSubscriptions_CreateOrUpdate. * * @param manager Entry point to MaintenanceManager. */ - public static void - applyUpdatesCreateOrUpdateParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() - .createOrUpdateParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "virtualMachines", "smdvm1", com.azure.core.util.Context.NONE); + public static void configurationAssignmentsForSubscriptionsCreateOrUpdate( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + ConfigurationAssignment resource = manager.configurationAssignmentsForSubscriptions() + .getWithResponse("workervmConfiguration", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withMaintenanceConfigurationId( + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") + .withFilter( + new ConfigurationAssignmentFilterProperties() + .withResourceTypes( + Arrays.asList("Microsoft.HybridCompute/machines", "Microsoft.Compute/virtualMachines")) + .withResourceGroups(Arrays.asList("RG1", "RG2")) + .withLocations(Arrays.asList("Japan East", "UK South")) + .withTagSettings(new TagSettingsProperties() + .withTags(mapOf("tag1", Arrays.asList("tag1Value1", "tag1Value2", "tag1Value3"), "tag2", + Arrays.asList("tag2Value1", "tag2Value2", "tag2Value3"))) + .withFilterOperator(TagOperators.ANY))) + .apply(); } -} -``` -### ApplyUpdates_Get - -```java -/** - * Samples for ApplyUpdates Get. - */ -public final class ApplyUpdatesGetSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_Get.json - */ - /** - * Sample code: ApplyUpdates_Get. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void applyUpdatesGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() - .getWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", com.azure.core.util.Context.NONE); + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -221,140 +215,180 @@ public final class ApplyUpdatesGetSamples { ### ApplyUpdates_GetParent ```java +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ApplyUpdates GetParent. + * Samples for ConfigurationAssignmentsForResourceGroup CreateOrUpdate. */ -public final class ApplyUpdatesGetParentSamples { +public final class ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_GetParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json */ /** - * Sample code: ApplyUpdates_GetParent. + * Sample code: ConfigurationAssignmentsForResourceGroup_CreateOrUpdate. * * @param manager Entry point to MaintenanceManager. */ - public static void applyUpdatesGetParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() - .getParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "virtualMachines", "smdvm1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", com.azure.core.util.Context.NONE); + public static void configurationAssignmentsForResourceGroupCreateOrUpdate( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForResourceGroups() + .createOrUpdateWithResponse("examplerg", "workervmConfiguration", + new ConfigurationAssignmentInner().withMaintenanceConfigurationId( + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") + .withFilter(new ConfigurationAssignmentFilterProperties() + .withResourceTypes( + Arrays.asList("Microsoft.HybridCompute/machines", "Microsoft.Compute/virtualMachines")) + .withLocations(Arrays.asList("Japan East", "UK South")) + .withTagSettings(new TagSettingsProperties() + .withTags(mapOf("tag1", Arrays.asList("tag1Value1", "tag1Value2", "tag1Value3"), "tag2", + Arrays.asList("tag2Value1", "tag2Value2", "tag2Value3"))) + .withFilterOperator(TagOperators.ANY))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### ApplyUpdates_List +### ApplyUpdatesOperationGroup_CreateOrUpdate ```java /** - * Samples for ApplyUpdates List. + * Samples for Operations List. */ -public final class ApplyUpdatesListSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_List.json + * x-ms-original-file: 2023-10-01-preview/Operations_List.json */ /** - * Sample code: ApplyUpdates_List. + * Sample code: Operations_List. * * @param manager Entry point to MaintenanceManager. */ - public static void applyUpdatesList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates().list(com.azure.core.util.Context.NONE); + public static void operationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignments_CreateOrUpdate +### ApplyUpdatesOperationGroup_CreateOrUpdateParent ```java -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for ConfigurationAssignments CreateOrUpdate. + * Samples for ConfigurationAssignmentsForSubscriptions CreateOrUpdate. */ -public final class ConfigurationAssignmentsCreateOrUpdateSamples { +public final class ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json */ /** - * Sample code: ConfigurationAssignments_CreateOrUpdate. + * Sample code: ConfigurationAssignmentsForSubscriptions_CreateOrUpdate. * * @param manager Entry point to MaintenanceManager. */ - public static void - configurationAssignmentsCreateOrUpdate(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .createOrUpdateWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "workervmConfiguration", - new ConfigurationAssignmentInner().withMaintenanceConfigurationId( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1"), - com.azure.core.util.Context.NONE); + public static void configurationAssignmentsForSubscriptionsCreateOrUpdate( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForSubscriptions() + .define("workervmConfiguration") + .withMaintenanceConfigurationId( + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") + .withFilter( + new ConfigurationAssignmentFilterProperties() + .withResourceTypes( + Arrays.asList("Microsoft.HybridCompute/machines", "Microsoft.Compute/virtualMachines")) + .withResourceGroups(Arrays.asList("RG1", "RG2")) + .withLocations(Arrays.asList("Japan East", "UK South")) + .withTagSettings(new TagSettingsProperties() + .withTags(mapOf("tag1", Arrays.asList("tag1Value1", "tag1Value2", "tag1Value3"), "tag2", + Arrays.asList("tag2Value1", "tag2Value2", "tag2Value3"))) + .withFilterOperator(TagOperators.ANY))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### ConfigurationAssignments_CreateOrUpdateParent +### ConfigurationAssignmentForResourceGroupOperationGroup_List ```java -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; - /** - * Samples for ConfigurationAssignments CreateOrUpdateParent. + * Samples for MaintenanceConfigurationOperationGroup ListByResourceGroup. */ -public final class ConfigurationAssignmentsCreateOrUpdateParentSamples { +public final class MaintenanceConfigurationOperationGroupListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_CreateOrUpdateParent.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurationsResourceGroup_List.json */ /** - * Sample code: ConfigurationAssignments_CreateOrUpdateParent. + * Sample code: MaintenanceConfigurationsResourceGroup_List. * * @param manager Entry point to MaintenanceManager. */ public static void - configurationAssignmentsCreateOrUpdateParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .createOrUpdateParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "virtualMachines", "smdvm1", "workervmPolicy", - new ConfigurationAssignmentInner().withMaintenanceConfigurationId( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"), - com.azure.core.util.Context.NONE); + maintenanceConfigurationsResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups() + .listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignments_Delete +### ConfigurationAssignmentOperationGroup_CreateOrUpdate ```java /** - * Samples for ConfigurationAssignments Delete. + * Samples for ConfigurationAssignmentsForResourceGroup Delete. */ -public final class ConfigurationAssignmentsDeleteSamples { +public final class ConfigurationAssignmentsForResourceGroupDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_Delete.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_Delete.json */ /** - * Sample code: ConfigurationAssignments_Delete. + * Sample code: ConfigurationAssignmentsForResourceGroup_Delete. * * @param manager Entry point to MaintenanceManager. */ - public static void - configurationAssignmentsDelete(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .deleteWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "workervmConfiguration", com.azure.core.util.Context.NONE); + public static void configurationAssignmentsForResourceGroupDelete( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForResourceGroups() + .deleteByResourceGroupWithResponse("examplerg", "workervmConfiguration", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignments_DeleteParent +### ConfigurationAssignmentOperationGroup_Delete ```java /** @@ -362,9 +396,7 @@ public final class ConfigurationAssignmentsDeleteSamples { */ public final class ConfigurationAssignmentsDeleteParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_DeleteParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_DeleteParent.json */ /** * Sample code: ConfigurationAssignments_DeleteParent. @@ -380,109 +412,54 @@ public final class ConfigurationAssignmentsDeleteParentSamples { } ``` -### ConfigurationAssignments_Get +### ConfigurationAssignmentOperationGroup_Get ```java /** - * Samples for ConfigurationAssignments Get. + * Samples for ScheduledEventOperationGroup Acknowledge. */ -public final class ConfigurationAssignmentsGetSamples { +public final class ScheduledEventOperationGroupAcknowledgeSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_Get.json + * x-ms-original-file: 2023-10-01-preview/ScheduledEvents_Acknowledge.json */ /** - * Sample code: ConfigurationAssignments_Get. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void configurationAssignmentsGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .getWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "workervmConfiguration", com.azure.core.util.Context.NONE); - } -} -``` - -### ConfigurationAssignments_GetParent - -```java -/** - * Samples for ConfigurationAssignments GetParent. - */ -public final class ConfigurationAssignmentsGetParentSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_GetParent.json - */ - /** - * Sample code: ConfigurationAssignments_GetParent. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void - configurationAssignmentsGetParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .getParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - "virtualMachines", "smdvm1", "workervmPolicy", com.azure.core.util.Context.NONE); - } -} -``` - -### ConfigurationAssignments_List - -```java -/** - * Samples for ConfigurationAssignments List. - */ -public final class ConfigurationAssignmentsListSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_List.json - */ - /** - * Sample code: ConfigurationAssignments_List. + * Sample code: ScheduledEvents_Acknowledge. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .list("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - com.azure.core.util.Context.NONE); + public static void scheduledEventsAcknowledge(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.scheduledEventOperationGroups() + .acknowledgeWithResponse("examplerg", "virtualMachines", "configuration1", + "ad6d85cf-2c9e-4eec-9a1e-af3213cc0486", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignments_ListParent +### ConfigurationAssignments_CreateOrUpdateParent ```java /** - * Samples for ConfigurationAssignments ListParent. + * Samples for ConfigurationAssignmentOperationGroup Delete. */ -public final class ConfigurationAssignmentsListParentSamples { +public final class ConfigurationAssignmentOperationGroupDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_ListParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_Delete.json */ /** - * Sample code: ConfigurationAssignments_ListParent. + * Sample code: ConfigurationAssignments_Delete. * * @param manager Entry point to MaintenanceManager. */ public static void - configurationAssignmentsListParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() - .listParent("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", - "smdtestvm1", com.azure.core.util.Context.NONE); + configurationAssignmentsDelete(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentOperationGroups() + .deleteWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "workervmConfiguration", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsForResourceGroup_CreateOrUpdate +### ConfigurationAssignments_DeleteParent ```java import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; @@ -494,13 +471,11 @@ import java.util.HashMap; import java.util.Map; /** - * Samples for ConfigurationAssignmentsForResourceGroup CreateOrUpdate. + * Samples for ConfigurationAssignmentsForResourceGroup Update. */ -public final class ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples { +public final class ConfigurationAssignmentsForResourceGroupUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_UpdateForResource.json */ /** * Sample code: ConfigurationAssignmentsForResourceGroup_CreateOrUpdate. @@ -510,7 +485,7 @@ public final class ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples public static void configurationAssignmentsForResourceGroupCreateOrUpdate( com.azure.resourcemanager.maintenance.MaintenanceManager manager) { manager.configurationAssignmentsForResourceGroups() - .createOrUpdateWithResponse("examplerg", "workervmConfiguration", + .updateWithResponse("examplerg", "workervmConfiguration", new ConfigurationAssignmentInner().withMaintenanceConfigurationId( "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") .withFilter(new ConfigurationAssignmentFilterProperties() @@ -538,108 +513,172 @@ public final class ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples } ``` -### ConfigurationAssignmentsForResourceGroup_Delete +### ConfigurationAssignments_GetParent ```java /** - * Samples for ConfigurationAssignmentsForResourceGroup Delete. + * Samples for MaintenanceConfigurationOperationGroup List. */ -public final class ConfigurationAssignmentsForResourceGroupDeleteSamples { +public final class MaintenanceConfigurationOperationGroupListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_Delete.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_List.json */ /** - * Sample code: ConfigurationAssignmentsForResourceGroup_Delete. + * Sample code: MaintenanceConfigurations_List. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsForResourceGroupDelete( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsForResourceGroups() - .deleteByResourceGroupWithResponse("examplerg", "workervmConfiguration", com.azure.core.util.Context.NONE); + public static void maintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups().list(com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsForResourceGroup_GetByResourceGroup +### ConfigurationAssignments_ListParent ```java /** - * Samples for ConfigurationAssignmentsForResourceGroup GetByResourceGroup. + * Samples for ConfigurationAssignmentsForSubscriptions Get. */ -public final class ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples { +public final class ConfigurationAssignmentsForSubscriptionsGetSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_Get.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_Get.json */ /** - * Sample code: ConfigurationAssignmentsForResourceGroup_Get. + * Sample code: ConfigurationAssignments_GetParent. * * @param manager Entry point to MaintenanceManager. */ public static void - configurationAssignmentsForResourceGroupGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsForResourceGroups() - .getByResourceGroupWithResponse("examplerg", "workervmConfiguration", com.azure.core.util.Context.NONE); + configurationAssignmentsGetParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForSubscriptions() + .getWithResponse("workervmConfiguration", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsForResourceGroup_Update +### ConfigurationAssignmentsForResourceGroup_CreateOrUpdate + +```java +/** + * Samples for ConfigurationAssignmentOperationGroup Get. + */ +public final class ConfigurationAssignmentOperationGroupGetSamples { + /* + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_Get.json + */ + /** + * Sample code: ConfigurationAssignments_Get. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void configurationAssignmentsGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentOperationGroups() + .getWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "workervmConfiguration", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationAssignmentsForResourceGroup_Delete ```java import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; /** - * Samples for ConfigurationAssignmentsForResourceGroup Update. + * Samples for ConfigurationAssignments CreateOrUpdateParent. */ -public final class ConfigurationAssignmentsForResourceGroupUpdateSamples { +public final class ConfigurationAssignmentsCreateOrUpdateParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_UpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_CreateOrUpdateParent.json */ /** - * Sample code: ConfigurationAssignmentsForResourceGroup_CreateOrUpdate. + * Sample code: ConfigurationAssignments_CreateOrUpdateParent. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsForResourceGroupCreateOrUpdate( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsForResourceGroups() - .updateWithResponse("examplerg", "workervmConfiguration", + public static void + configurationAssignmentsCreateOrUpdateParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignments() + .createOrUpdateParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "virtualMachines", "smdvm1", "workervmPolicy", new ConfigurationAssignmentInner().withMaintenanceConfigurationId( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes( - Arrays.asList("Microsoft.HybridCompute/machines", "Microsoft.Compute/virtualMachines")) - .withLocations(Arrays.asList("Japan East", "UK South")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("tag1", Arrays.asList("tag1Value1", "tag1Value2", "tag1Value3"), "tag2", - Arrays.asList("tag2Value1", "tag2Value2", "tag2Value3"))) - .withFilterOperator(TagOperators.ANY))), + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/policy1"), com.azure.core.util.Context.NONE); } +} +``` - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; +### ConfigurationAssignmentsForResourceGroup_GetByResourceGroup + +```java +/** + * Samples for MaintenanceConfigurationOperationGroup GetByResourceGroup. + */ +public final class MaintenanceConfigurationOperationGroupGetByResourceGroupSamples { + /* + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json + */ + /** + * Sample code: MaintenanceConfigurations_GetForResource_GuestOSPatchWindows. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void maintenanceConfigurationsGetForResourceGuestOSPatchWindows( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups() + .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json + */ + /** + * Sample code: MaintenanceConfigurations_GetForResource_GuestOSPatchLinux. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void maintenanceConfigurationsGetForResourceGuestOSPatchLinux( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups() + .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource.json + */ + /** + * Sample code: MaintenanceConfigurations_GetForResource. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void + maintenanceConfigurationsGetForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups() + .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationAssignmentsForResourceGroup_Update + +```java +/** + * Samples for ApplyUpdatesOperationGroup CreateOrUpdate. + */ +public final class ApplyUpdatesOperationGroupCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdate.json + */ + /** + * Sample code: ApplyUpdates_CreateOrUpdate. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void applyUpdatesCreateOrUpdate(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdatesOperationGroups() + .createOrUpdateWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + com.azure.core.util.Context.NONE); } } ``` @@ -647,208 +686,175 @@ public final class ConfigurationAssignmentsForResourceGroupUpdateSamples { ### ConfigurationAssignmentsForSubscriptions_CreateOrUpdate ```java -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +/** + * Samples for ApplyUpdateOperationGroup List. + */ +public final class ApplyUpdateOperationGroupListSamples { + /* + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_List.json + */ + /** + * Sample code: ApplyUpdates_List. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void applyUpdatesList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdateOperationGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationAssignmentsForSubscriptions_Delete +```java /** - * Samples for ConfigurationAssignmentsForSubscriptions CreateOrUpdate. + * Samples for ConfigurationAssignmentForResourceGroupOperationGroup List. */ -public final class ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples { +public final class ConfigurationAssignmentForResourceGroupOperationGroupListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_List.json */ /** - * Sample code: ConfigurationAssignmentsForSubscriptions_CreateOrUpdate. + * Sample code: ConfigurationAssignments_List. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsForSubscriptionsCreateOrUpdate( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsForSubscriptions() - .define("workervmConfiguration") - .withMaintenanceConfigurationId( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") - .withFilter( - new ConfigurationAssignmentFilterProperties() - .withResourceTypes( - Arrays.asList("Microsoft.HybridCompute/machines", "Microsoft.Compute/virtualMachines")) - .withResourceGroups(Arrays.asList("RG1", "RG2")) - .withLocations(Arrays.asList("Japan East", "UK South")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("tag1", Arrays.asList("tag1Value1", "tag1Value2", "tag1Value3"), "tag2", - Arrays.asList("tag2Value1", "tag2Value2", "tag2Value3"))) - .withFilterOperator(TagOperators.ANY))) - .create(); + public static void configurationAssignmentsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentForResourceGroupOperationGroups() + .list("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + com.azure.core.util.Context.NONE); } +} +``` - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; +### ConfigurationAssignmentsForSubscriptions_Get + +```java +/** + * Samples for MaintenanceConfigurationOperationGroup Delete. + */ +public final class MaintenanceConfigurationOperationGroupDeleteSamples { + /* + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_DeleteForResource.json + */ + /** + * Sample code: MaintenanceConfigurations_DeleteForResource. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void + maintenanceConfigurationsDeleteForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups() + .deleteByResourceGroupWithResponse("examplerg", "example1", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsForSubscriptions_Delete +### ConfigurationAssignmentsForSubscriptions_List ```java /** - * Samples for ConfigurationAssignmentsForSubscriptions Delete. + * Samples for ApplyUpdateOperationGroup Get. */ -public final class ConfigurationAssignmentsForSubscriptionsDeleteSamples { +public final class ApplyUpdateOperationGroupGetSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_Delete.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_Get.json */ /** - * Sample code: ConfigurationAssignmentsForSubscriptions_Delete. + * Sample code: ApplyUpdates_Get. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsForSubscriptionsDelete( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsForSubscriptions() - .deleteWithResponse("workervmConfiguration", com.azure.core.util.Context.NONE); + public static void applyUpdatesGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdateOperationGroups() + .getWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsForSubscriptions_Get +### ConfigurationAssignmentsForSubscriptions_Update ```java /** - * Samples for ConfigurationAssignmentsForSubscriptions Get. + * Samples for ConfigurationAssignments ListParent. */ -public final class ConfigurationAssignmentsForSubscriptionsGetSamples { +public final class ConfigurationAssignmentsListParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_Get.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_ListParent.json */ /** - * Sample code: ConfigurationAssignments_GetParent. + * Sample code: ConfigurationAssignments_ListParent. * * @param manager Entry point to MaintenanceManager. */ public static void - configurationAssignmentsGetParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsForSubscriptions() - .getWithResponse("workervmConfiguration", com.azure.core.util.Context.NONE); + configurationAssignmentsListParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignments() + .listParent("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", + "smdtestvm1", com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsForSubscriptions_Update +### MaintenanceConfigurationOperationGroup_CreateOrUpdate ```java -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for ConfigurationAssignmentsForSubscriptions Update. + * Samples for UpdatesOperationGroup List. */ -public final class ConfigurationAssignmentsForSubscriptionsUpdateSamples { +public final class UpdatesOperationGroupListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_UpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/Updates_List.json */ /** - * Sample code: ConfigurationAssignmentsForSubscriptions_CreateOrUpdate. + * Sample code: Updates_List. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsForSubscriptionsCreateOrUpdate( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - ConfigurationAssignment resource = manager.configurationAssignmentsForSubscriptions() - .getWithResponse("workervmConfiguration", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withMaintenanceConfigurationId( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/examplerg/providers/Microsoft.Maintenance/maintenanceConfigurations/configuration1") - .withFilter( - new ConfigurationAssignmentFilterProperties() - .withResourceTypes( - Arrays.asList("Microsoft.HybridCompute/machines", "Microsoft.Compute/virtualMachines")) - .withResourceGroups(Arrays.asList("RG1", "RG2")) - .withLocations(Arrays.asList("Japan East", "UK South")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("tag1", Arrays.asList("tag1Value1", "tag1Value2", "tag1Value3"), "tag2", - Arrays.asList("tag2Value1", "tag2Value2", "tag2Value3"))) - .withFilterOperator(TagOperators.ANY))) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void updatesList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.updatesOperationGroups() + .list("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + com.azure.core.util.Context.NONE); } } ``` -### ConfigurationAssignmentsWithinSubscription_List +### MaintenanceConfigurationOperationGroup_Delete ```java /** - * Samples for ConfigurationAssignmentsWithinSubscription List. + * Samples for ConfigurationAssignmentsForSubscriptions Delete. */ -public final class ConfigurationAssignmentsWithinSubscriptionListSamples { +public final class ConfigurationAssignmentsForSubscriptionsDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsResultWithinSubscription_List.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_Delete.json */ /** - * Sample code: ConfigurationAssignmentsResultWithinSubscription_List. + * Sample code: ConfigurationAssignmentsForSubscriptions_Delete. * * @param manager Entry point to MaintenanceManager. */ - public static void configurationAssignmentsResultWithinSubscriptionList( + public static void configurationAssignmentsForSubscriptionsDelete( com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsWithinSubscriptions().list(com.azure.core.util.Context.NONE); + manager.configurationAssignmentsForSubscriptions() + .deleteWithResponse("workervmConfiguration", com.azure.core.util.Context.NONE); } } ``` -### MaintenanceConfigurations_CreateOrUpdate +### MaintenanceConfigurationOperationGroup_GetByResourceGroup ```java import com.azure.resourcemanager.maintenance.models.MaintenanceScope; import com.azure.resourcemanager.maintenance.models.Visibility; /** - * Samples for MaintenanceConfigurations CreateOrUpdate. + * Samples for MaintenanceConfigurationOperationGroup CreateOrUpdate. */ -public final class MaintenanceConfigurationsCreateOrUpdateSamples { +public final class MaintenanceConfigurationOperationGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_CreateOrUpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_CreateOrUpdateForResource.json */ /** * Sample code: MaintenanceConfigurations_CreateOrUpdateForResource. @@ -857,10 +863,10 @@ public final class MaintenanceConfigurationsCreateOrUpdateSamples { */ public static void maintenanceConfigurationsCreateOrUpdateForResource( com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() + manager.maintenanceConfigurationOperationGroups() .define("configuration1") - .withExistingResourceGroup("examplerg") .withRegion("westus2") + .withExistingResourceGroup("examplerg") .withNamespace("Microsoft.Maintenance") .withMaintenanceScope(MaintenanceScope.OSIMAGE) .withVisibility(Visibility.CUSTOM) @@ -874,171 +880,113 @@ public final class MaintenanceConfigurationsCreateOrUpdateSamples { } ``` -### MaintenanceConfigurations_Delete +### MaintenanceConfigurationOperationGroup_List ```java /** - * Samples for MaintenanceConfigurations Delete. + * Samples for ConfigurationAssignmentsForResourceGroup GetByResourceGroup. */ -public final class MaintenanceConfigurationsDeleteSamples { +public final class ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_DeleteForResource.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_Get.json */ /** - * Sample code: MaintenanceConfigurations_DeleteForResource. + * Sample code: ConfigurationAssignmentsForResourceGroup_Get. * * @param manager Entry point to MaintenanceManager. */ public static void - maintenanceConfigurationsDeleteForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() - .deleteByResourceGroupWithResponse("examplerg", "example1", com.azure.core.util.Context.NONE); + configurationAssignmentsForResourceGroupGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForResourceGroups() + .getByResourceGroupWithResponse("examplerg", "workervmConfiguration", com.azure.core.util.Context.NONE); } } ``` -### MaintenanceConfigurations_GetByResourceGroup +### MaintenanceConfigurationOperationGroup_ListByResourceGroup ```java /** - * Samples for MaintenanceConfigurations GetByResourceGroup. + * Samples for MaintenanceConfigurations List. */ -public final class MaintenanceConfigurationsGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json - */ - /** - * Sample code: MaintenanceConfigurations_GetForResource_GuestOSPatchWindows. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void maintenanceConfigurationsGetForResourceGuestOSPatchWindows( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() - .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json - */ - /** - * Sample code: MaintenanceConfigurations_GetForResource_GuestOSPatchLinux. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void maintenanceConfigurationsGetForResourceGuestOSPatchLinux( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() - .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); - } - +public final class MaintenanceConfigurationsListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_GetForResource.json + * x-ms-original-file: 2023-10-01-preview/PublicMaintenanceConfigurations_List.json */ /** - * Sample code: MaintenanceConfigurations_GetForResource. + * Sample code: PublicMaintenanceConfigurations_List. * * @param manager Entry point to MaintenanceManager. */ public static void - maintenanceConfigurationsGetForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() - .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); + publicMaintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurations().list(com.azure.core.util.Context.NONE); } } ``` -### MaintenanceConfigurations_List +### MaintenanceConfigurationOperationGroup_Update ```java /** - * Samples for MaintenanceConfigurations List. + * Samples for MaintenanceConfigurations Get. */ -public final class MaintenanceConfigurationsListSamples { +public final class MaintenanceConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_List.json + * x-ms-original-file: 2023-10-01-preview/PublicMaintenanceConfigurations_GetForResource.json */ /** - * Sample code: MaintenanceConfigurations_List. + * Sample code: PublicMaintenanceConfigurations_GetForResource. * * @param manager Entry point to MaintenanceManager. */ - public static void maintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations().list(com.azure.core.util.Context.NONE); + public static void publicMaintenanceConfigurationsGetForResource( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurations().getWithResponse("configuration1", com.azure.core.util.Context.NONE); } } ``` -### MaintenanceConfigurations_Update +### MaintenanceConfigurations_Get ```java -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.Visibility; - /** - * Samples for MaintenanceConfigurations Update. + * Samples for UpdatesOperationGroup ListParent. */ -public final class MaintenanceConfigurationsUpdateSamples { +public final class UpdatesOperationGroupListParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_UpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/Updates_ListParent.json */ /** - * Sample code: MaintenanceConfigurations_UpdateForResource. + * Sample code: Updates_ListParent. * * @param manager Entry point to MaintenanceManager. */ - public static void - maintenanceConfigurationsUpdateForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - MaintenanceConfiguration resource = manager.maintenanceConfigurations() - .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withNamespace("Microsoft.Maintenance") - .withMaintenanceScope(MaintenanceScope.OSIMAGE) - .withVisibility(Visibility.CUSTOM) - .withStartDateTime("2020-04-30 08:00") - .withExpirationDateTime("9999-12-31 00:00") - .withDuration("05:00") - .withTimeZone("Pacific Standard Time") - .withRecurEvery("Month Third Sunday") - .apply(); + public static void updatesListParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.updatesOperationGroups() + .listParent("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "1", + com.azure.core.util.Context.NONE); } } ``` -### MaintenanceConfigurationsForResourceGroup_ListByResourceGroup +### MaintenanceConfigurations_List ```java /** - * Samples for MaintenanceConfigurationsForResourceGroup ListByResourceGroup. + * Samples for ApplyUpdateForResourceGroupOperationGroup ListByResourceGroup. */ -public final class MaintenanceConfigurationsForResourceGroupListByResourceGroupSamples { +public final class ApplyUpdateForResourceGroupOperationGroupListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurationsResourceGroup_List.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdatesResourceGroup_List.json */ /** - * Sample code: MaintenanceConfigurationsResourceGroup_List. + * Sample code: ApplyUpdatesResourceGroup_List. * * @param manager Entry point to MaintenanceManager. */ - public static void - maintenanceConfigurationsResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurationsForResourceGroups() + public static void applyUpdatesResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdateForResourceGroupOperationGroups() .listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } @@ -1047,145 +995,126 @@ public final class MaintenanceConfigurationsForResourceGroupListByResourceGroupS ### Operations_List ```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * Operations_List.json - */ - /** - * Sample code: Operations_List. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void operationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### PublicMaintenanceConfigurations_Get +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.models.UpdateStatus; -```java /** - * Samples for PublicMaintenanceConfigurations Get. + * Samples for ApplyUpdateOperationGroup CreateOrUpdateOrCancel. */ -public final class PublicMaintenanceConfigurationsGetSamples { +public final class ApplyUpdateOperationGroupCreateOrUpdateOrCancelSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * PublicMaintenanceConfigurations_GetForResource.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdateOnly_NoCancellation.json */ /** - * Sample code: PublicMaintenanceConfigurations_GetForResource. + * Sample code: ApplyUpdates_CreateOrUpdateOnly_NoCancellation. * * @param manager Entry point to MaintenanceManager. */ - public static void publicMaintenanceConfigurationsGetForResource( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.publicMaintenanceConfigurations().getWithResponse("configuration1", com.azure.core.util.Context.NONE); + public static void + applyUpdatesCreateOrUpdateOnlyNoCancellation(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdateOperationGroups() + .createOrUpdateOrCancelWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "20230901121200", new ApplyUpdateInner(), com.azure.core.util.Context.NONE); } -} -``` -### PublicMaintenanceConfigurations_List - -```java -/** - * Samples for PublicMaintenanceConfigurations List. - */ -public final class PublicMaintenanceConfigurationsListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * PublicMaintenanceConfigurations_List.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdate_CancelMaintenance.json */ /** - * Sample code: PublicMaintenanceConfigurations_List. + * Sample code: ApplyUpdates_CreateOrUpdateOrCancel. * * @param manager Entry point to MaintenanceManager. */ public static void - publicMaintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.publicMaintenanceConfigurations().list(com.azure.core.util.Context.NONE); + applyUpdatesCreateOrUpdateOrCancel(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdateOperationGroups() + .createOrUpdateOrCancelWithResponse("examplerg", "Microsoft.Maintenance", "maintenanceConfigurations", + "maintenanceConfig1", "20230901121200", new ApplyUpdateInner().withStatus(UpdateStatus.CANCEL), + com.azure.core.util.Context.NONE); } } ``` -### ScheduledEvent_Acknowledge +### ScheduledEventOperationGroup_Acknowledge ```java /** - * Samples for ScheduledEvent Acknowledge. + * Samples for ApplyUpdatesOperationGroup CreateOrUpdateParent. */ -public final class ScheduledEventAcknowledgeSamples { +public final class ApplyUpdatesOperationGroupCreateOrUpdateParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ScheduledEvents_Acknowledge.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdateParent.json */ /** - * Sample code: ScheduledEvents_Acknowledge. + * Sample code: ApplyUpdates_CreateOrUpdateParent. * * @param manager Entry point to MaintenanceManager. */ - public static void scheduledEventsAcknowledge(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.scheduledEvents() - .acknowledgeWithResponse("examplerg", "virtualMachines", "configuration1", - "ad6d85cf-2c9e-4eec-9a1e-af3213cc0486", com.azure.core.util.Context.NONE); + public static void + applyUpdatesCreateOrUpdateParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdatesOperationGroups() + .createOrUpdateParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", + "virtualMachines", "smdvm1", com.azure.core.util.Context.NONE); } } ``` -### Updates_List +### UpdatesOperationGroup_List ```java /** - * Samples for Updates List. + * Samples for ConfigurationAssignmentsForSubscriptions List. */ -public final class UpdatesListSamples { +public final class ConfigurationAssignmentsForSubscriptionsListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/Updates_List - * .json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsResultWithinSubscription_List.json */ /** - * Sample code: Updates_List. + * Sample code: ConfigurationAssignmentsResultWithinSubscription_List. * * @param manager Entry point to MaintenanceManager. */ - public static void updatesList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.updates() - .list("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", - com.azure.core.util.Context.NONE); + public static void configurationAssignmentsResultWithinSubscriptionList( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForSubscriptions().list(com.azure.core.util.Context.NONE); } } ``` -### Updates_ListParent +### UpdatesOperationGroup_ListParent ```java +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.Visibility; + /** - * Samples for Updates ListParent. + * Samples for MaintenanceConfigurationOperationGroup Update. */ -public final class UpdatesListParentSamples { +public final class MaintenanceConfigurationOperationGroupUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * Updates_ListParent.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_UpdateForResource.json */ /** - * Sample code: Updates_ListParent. + * Sample code: MaintenanceConfigurations_UpdateForResource. * * @param manager Entry point to MaintenanceManager. */ - public static void updatesListParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.updates() - .listParent("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "1", - com.azure.core.util.Context.NONE); + public static void + maintenanceConfigurationsUpdateForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + MaintenanceConfiguration resource = manager.maintenanceConfigurationOperationGroups() + .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withNamespace("Microsoft.Maintenance") + .withMaintenanceScope(MaintenanceScope.OSIMAGE) + .withVisibility(Visibility.CUSTOM) + .withStartDateTime("2020-04-30 08:00") + .withExpirationDateTime("9999-12-31 00:00") + .withDuration("05:00") + .withTimeZone("Pacific Standard Time") + .withRecurEvery("Month Third Sunday") + .apply(); } } ``` diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml b/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml index a153d129753b..9594801d7236 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml +++ b/sdk/maintenance/azure-resourcemanager-maintenance/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Maintenance Management - This package contains Microsoft Azure SDK for Maintenance Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Maintenance Management Client. Package tag package-preview-2023-10. + This package contains Microsoft Azure SDK for Maintenance Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Maintenance Management Client. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/MaintenanceManager.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/MaintenanceManager.java index 53b164e06c7e..48657990a7df 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/MaintenanceManager.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/MaintenanceManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance; @@ -22,37 +22,43 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.maintenance.fluent.MaintenanceManagementClient; -import com.azure.resourcemanager.maintenance.implementation.ApplyUpdateForResourceGroupsImpl; +import com.azure.resourcemanager.maintenance.fluent.MaintenanceClient; +import com.azure.resourcemanager.maintenance.implementation.ApplyUpdateForResourceGroupOperationGroupsImpl; +import com.azure.resourcemanager.maintenance.implementation.ApplyUpdateOperationGroupsImpl; import com.azure.resourcemanager.maintenance.implementation.ApplyUpdatesImpl; +import com.azure.resourcemanager.maintenance.implementation.ApplyUpdatesOperationGroupsImpl; +import com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentForResourceGroupOperationGroupsImpl; +import com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentOperationGroupsImpl; import com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsForResourceGroupsImpl; import com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsForSubscriptionsImpl; import com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsImpl; -import com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsWithinSubscriptionsImpl; -import com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationsForResourceGroupsImpl; +import com.azure.resourcemanager.maintenance.implementation.MaintenanceClientBuilder; +import com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationOperationGroupsImpl; import com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationsImpl; -import com.azure.resourcemanager.maintenance.implementation.MaintenanceManagementClientBuilder; import com.azure.resourcemanager.maintenance.implementation.OperationsImpl; -import com.azure.resourcemanager.maintenance.implementation.PublicMaintenanceConfigurationsImpl; -import com.azure.resourcemanager.maintenance.implementation.ScheduledEventsImpl; -import com.azure.resourcemanager.maintenance.implementation.UpdatesImpl; -import com.azure.resourcemanager.maintenance.models.ApplyUpdateForResourceGroups; +import com.azure.resourcemanager.maintenance.implementation.ScheduledEventOperationGroupsImpl; +import com.azure.resourcemanager.maintenance.implementation.UpdatesOperationGroupsImpl; +import com.azure.resourcemanager.maintenance.models.ApplyUpdateForResourceGroupOperationGroups; +import com.azure.resourcemanager.maintenance.models.ApplyUpdateOperationGroups; import com.azure.resourcemanager.maintenance.models.ApplyUpdates; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroups; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentForResourceGroupOperationGroups; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentOperationGroups; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignments; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentsForResourceGroups; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentsForSubscriptions; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentsWithinSubscriptions; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfigurationOperationGroups; import com.azure.resourcemanager.maintenance.models.MaintenanceConfigurations; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfigurationsForResourceGroups; import com.azure.resourcemanager.maintenance.models.Operations; -import com.azure.resourcemanager.maintenance.models.PublicMaintenanceConfigurations; -import com.azure.resourcemanager.maintenance.models.ScheduledEvents; -import com.azure.resourcemanager.maintenance.models.Updates; +import com.azure.resourcemanager.maintenance.models.ScheduledEventOperationGroups; +import com.azure.resourcemanager.maintenance.models.UpdatesOperationGroups; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -61,36 +67,40 @@ * Azure Maintenance Management Client. */ public final class MaintenanceManager { - private ScheduledEvents scheduledEvents; + private Operations operations; + + private MaintenanceConfigurations maintenanceConfigurations; - private PublicMaintenanceConfigurations publicMaintenanceConfigurations; + private MaintenanceConfigurationOperationGroups maintenanceConfigurationOperationGroups; private ApplyUpdates applyUpdates; + private ApplyUpdateOperationGroups applyUpdateOperationGroups; + private ConfigurationAssignments configurationAssignments; - private MaintenanceConfigurations maintenanceConfigurations; + private ConfigurationAssignmentOperationGroups configurationAssignmentOperationGroups; - private MaintenanceConfigurationsForResourceGroups maintenanceConfigurationsForResourceGroups; + private ConfigurationAssignmentsForSubscriptions configurationAssignmentsForSubscriptions; - private ApplyUpdateForResourceGroups applyUpdateForResourceGroups; + private ConfigurationAssignmentsForResourceGroups configurationAssignmentsForResourceGroups; - private ConfigurationAssignmentsWithinSubscriptions configurationAssignmentsWithinSubscriptions; + private ScheduledEventOperationGroups scheduledEventOperationGroups; - private ConfigurationAssignmentsForSubscriptions configurationAssignmentsForSubscriptions; + private ApplyUpdatesOperationGroups applyUpdatesOperationGroups; - private ConfigurationAssignmentsForResourceGroups configurationAssignmentsForResourceGroups; + private ApplyUpdateForResourceGroupOperationGroups applyUpdateForResourceGroupOperationGroups; - private Operations operations; + private ConfigurationAssignmentForResourceGroupOperationGroups configurationAssignmentForResourceGroupOperationGroups; - private Updates updates; + private UpdatesOperationGroups updatesOperationGroups; - private final MaintenanceManagementClient clientObject; + private final MaintenanceClient clientObject; private MaintenanceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new MaintenanceManagementClientBuilder().pipeline(httpPipeline) + this.clientObject = new MaintenanceClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -137,6 +147,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-maintenance.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -244,12 +257,14 @@ public MaintenanceManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.maintenance") .append("/") - .append("1.1.0-beta.2"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -296,28 +311,41 @@ public MaintenanceManager authenticate(TokenCredential credential, AzureProfile } /** - * Gets the resource collection API of ScheduledEvents. + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of MaintenanceConfigurations. * - * @return Resource collection API of ScheduledEvents. + * @return Resource collection API of MaintenanceConfigurations. */ - public ScheduledEvents scheduledEvents() { - if (this.scheduledEvents == null) { - this.scheduledEvents = new ScheduledEventsImpl(clientObject.getScheduledEvents(), this); + public MaintenanceConfigurations maintenanceConfigurations() { + if (this.maintenanceConfigurations == null) { + this.maintenanceConfigurations + = new MaintenanceConfigurationsImpl(clientObject.getMaintenanceConfigurations(), this); } - return scheduledEvents; + return maintenanceConfigurations; } /** - * Gets the resource collection API of PublicMaintenanceConfigurations. + * Gets the resource collection API of MaintenanceConfigurationOperationGroups. It manages MaintenanceConfiguration. * - * @return Resource collection API of PublicMaintenanceConfigurations. + * @return Resource collection API of MaintenanceConfigurationOperationGroups. */ - public PublicMaintenanceConfigurations publicMaintenanceConfigurations() { - if (this.publicMaintenanceConfigurations == null) { - this.publicMaintenanceConfigurations - = new PublicMaintenanceConfigurationsImpl(clientObject.getPublicMaintenanceConfigurations(), this); + public MaintenanceConfigurationOperationGroups maintenanceConfigurationOperationGroups() { + if (this.maintenanceConfigurationOperationGroups == null) { + this.maintenanceConfigurationOperationGroups = new MaintenanceConfigurationOperationGroupsImpl( + clientObject.getMaintenanceConfigurationOperationGroups(), this); } - return publicMaintenanceConfigurations; + return maintenanceConfigurationOperationGroups; } /** @@ -332,6 +360,19 @@ public ApplyUpdates applyUpdates() { return applyUpdates; } + /** + * Gets the resource collection API of ApplyUpdateOperationGroups. + * + * @return Resource collection API of ApplyUpdateOperationGroups. + */ + public ApplyUpdateOperationGroups applyUpdateOperationGroups() { + if (this.applyUpdateOperationGroups == null) { + this.applyUpdateOperationGroups + = new ApplyUpdateOperationGroupsImpl(clientObject.getApplyUpdateOperationGroups(), this); + } + return applyUpdateOperationGroups; + } + /** * Gets the resource collection API of ConfigurationAssignments. * @@ -346,114 +387,118 @@ public ConfigurationAssignments configurationAssignments() { } /** - * Gets the resource collection API of MaintenanceConfigurations. It manages MaintenanceConfiguration. + * Gets the resource collection API of ConfigurationAssignmentOperationGroups. * - * @return Resource collection API of MaintenanceConfigurations. + * @return Resource collection API of ConfigurationAssignmentOperationGroups. */ - public MaintenanceConfigurations maintenanceConfigurations() { - if (this.maintenanceConfigurations == null) { - this.maintenanceConfigurations - = new MaintenanceConfigurationsImpl(clientObject.getMaintenanceConfigurations(), this); + public ConfigurationAssignmentOperationGroups configurationAssignmentOperationGroups() { + if (this.configurationAssignmentOperationGroups == null) { + this.configurationAssignmentOperationGroups = new ConfigurationAssignmentOperationGroupsImpl( + clientObject.getConfigurationAssignmentOperationGroups(), this); } - return maintenanceConfigurations; + return configurationAssignmentOperationGroups; } /** - * Gets the resource collection API of MaintenanceConfigurationsForResourceGroups. + * Gets the resource collection API of ConfigurationAssignmentsForSubscriptions. It manages ConfigurationAssignment. * - * @return Resource collection API of MaintenanceConfigurationsForResourceGroups. + * @return Resource collection API of ConfigurationAssignmentsForSubscriptions. */ - public MaintenanceConfigurationsForResourceGroups maintenanceConfigurationsForResourceGroups() { - if (this.maintenanceConfigurationsForResourceGroups == null) { - this.maintenanceConfigurationsForResourceGroups = new MaintenanceConfigurationsForResourceGroupsImpl( - clientObject.getMaintenanceConfigurationsForResourceGroups(), this); + public ConfigurationAssignmentsForSubscriptions configurationAssignmentsForSubscriptions() { + if (this.configurationAssignmentsForSubscriptions == null) { + this.configurationAssignmentsForSubscriptions = new ConfigurationAssignmentsForSubscriptionsImpl( + clientObject.getConfigurationAssignmentsForSubscriptions(), this); } - return maintenanceConfigurationsForResourceGroups; + return configurationAssignmentsForSubscriptions; } /** - * Gets the resource collection API of ApplyUpdateForResourceGroups. + * Gets the resource collection API of ConfigurationAssignmentsForResourceGroups. * - * @return Resource collection API of ApplyUpdateForResourceGroups. + * @return Resource collection API of ConfigurationAssignmentsForResourceGroups. */ - public ApplyUpdateForResourceGroups applyUpdateForResourceGroups() { - if (this.applyUpdateForResourceGroups == null) { - this.applyUpdateForResourceGroups - = new ApplyUpdateForResourceGroupsImpl(clientObject.getApplyUpdateForResourceGroups(), this); + public ConfigurationAssignmentsForResourceGroups configurationAssignmentsForResourceGroups() { + if (this.configurationAssignmentsForResourceGroups == null) { + this.configurationAssignmentsForResourceGroups = new ConfigurationAssignmentsForResourceGroupsImpl( + clientObject.getConfigurationAssignmentsForResourceGroups(), this); } - return applyUpdateForResourceGroups; + return configurationAssignmentsForResourceGroups; } /** - * Gets the resource collection API of ConfigurationAssignmentsWithinSubscriptions. + * Gets the resource collection API of ScheduledEventOperationGroups. * - * @return Resource collection API of ConfigurationAssignmentsWithinSubscriptions. + * @return Resource collection API of ScheduledEventOperationGroups. */ - public ConfigurationAssignmentsWithinSubscriptions configurationAssignmentsWithinSubscriptions() { - if (this.configurationAssignmentsWithinSubscriptions == null) { - this.configurationAssignmentsWithinSubscriptions = new ConfigurationAssignmentsWithinSubscriptionsImpl( - clientObject.getConfigurationAssignmentsWithinSubscriptions(), this); + public ScheduledEventOperationGroups scheduledEventOperationGroups() { + if (this.scheduledEventOperationGroups == null) { + this.scheduledEventOperationGroups + = new ScheduledEventOperationGroupsImpl(clientObject.getScheduledEventOperationGroups(), this); } - return configurationAssignmentsWithinSubscriptions; + return scheduledEventOperationGroups; } /** - * Gets the resource collection API of ConfigurationAssignmentsForSubscriptions. It manages ConfigurationAssignment. + * Gets the resource collection API of ApplyUpdatesOperationGroups. * - * @return Resource collection API of ConfigurationAssignmentsForSubscriptions. + * @return Resource collection API of ApplyUpdatesOperationGroups. */ - public ConfigurationAssignmentsForSubscriptions configurationAssignmentsForSubscriptions() { - if (this.configurationAssignmentsForSubscriptions == null) { - this.configurationAssignmentsForSubscriptions = new ConfigurationAssignmentsForSubscriptionsImpl( - clientObject.getConfigurationAssignmentsForSubscriptions(), this); + public ApplyUpdatesOperationGroups applyUpdatesOperationGroups() { + if (this.applyUpdatesOperationGroups == null) { + this.applyUpdatesOperationGroups + = new ApplyUpdatesOperationGroupsImpl(clientObject.getApplyUpdatesOperationGroups(), this); } - return configurationAssignmentsForSubscriptions; + return applyUpdatesOperationGroups; } /** - * Gets the resource collection API of ConfigurationAssignmentsForResourceGroups. + * Gets the resource collection API of ApplyUpdateForResourceGroupOperationGroups. * - * @return Resource collection API of ConfigurationAssignmentsForResourceGroups. + * @return Resource collection API of ApplyUpdateForResourceGroupOperationGroups. */ - public ConfigurationAssignmentsForResourceGroups configurationAssignmentsForResourceGroups() { - if (this.configurationAssignmentsForResourceGroups == null) { - this.configurationAssignmentsForResourceGroups = new ConfigurationAssignmentsForResourceGroupsImpl( - clientObject.getConfigurationAssignmentsForResourceGroups(), this); + public ApplyUpdateForResourceGroupOperationGroups applyUpdateForResourceGroupOperationGroups() { + if (this.applyUpdateForResourceGroupOperationGroups == null) { + this.applyUpdateForResourceGroupOperationGroups = new ApplyUpdateForResourceGroupOperationGroupsImpl( + clientObject.getApplyUpdateForResourceGroupOperationGroups(), this); } - return configurationAssignmentsForResourceGroups; + return applyUpdateForResourceGroupOperationGroups; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of ConfigurationAssignmentForResourceGroupOperationGroups. * - * @return Resource collection API of Operations. + * @return Resource collection API of ConfigurationAssignmentForResourceGroupOperationGroups. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public ConfigurationAssignmentForResourceGroupOperationGroups + configurationAssignmentForResourceGroupOperationGroups() { + if (this.configurationAssignmentForResourceGroupOperationGroups == null) { + this.configurationAssignmentForResourceGroupOperationGroups + = new ConfigurationAssignmentForResourceGroupOperationGroupsImpl( + clientObject.getConfigurationAssignmentForResourceGroupOperationGroups(), this); } - return operations; + return configurationAssignmentForResourceGroupOperationGroups; } /** - * Gets the resource collection API of Updates. + * Gets the resource collection API of UpdatesOperationGroups. * - * @return Resource collection API of Updates. + * @return Resource collection API of UpdatesOperationGroups. */ - public Updates updates() { - if (this.updates == null) { - this.updates = new UpdatesImpl(clientObject.getUpdates(), this); + public UpdatesOperationGroups updatesOperationGroups() { + if (this.updatesOperationGroups == null) { + this.updatesOperationGroups + = new UpdatesOperationGroupsImpl(clientObject.getUpdatesOperationGroups(), this); } - return updates; + return updatesOperationGroups; } /** - * Gets wrapped service client MaintenanceManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets wrapped service client MaintenanceClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. * - * @return Wrapped service client MaintenanceManagementClient. + * @return Wrapped service client MaintenanceClient. */ - public MaintenanceManagementClient serviceClient() { + public MaintenanceClient serviceClient() { return this.clientObject; } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateForResourceGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateForResourceGroupOperationGroupsClient.java similarity index 83% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateForResourceGroupsClient.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateForResourceGroupOperationGroupsClient.java index d363b151644f..128995d401a0 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateForResourceGroupsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateForResourceGroupOperationGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -11,13 +11,14 @@ import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; /** - * An instance of this class provides access to all the operations defined in ApplyUpdateForResourceGroupsClient. + * An instance of this class provides access to all the operations defined in + * ApplyUpdateForResourceGroupOperationGroupsClient. */ -public interface ApplyUpdateForResourceGroupsClient { +public interface ApplyUpdateForResourceGroupOperationGroupsClient { /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -30,7 +31,7 @@ public interface ApplyUpdateForResourceGroupsClient { /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateOperationGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateOperationGroupsClient.java new file mode 100644 index 000000000000..a97ddbc39f06 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdateOperationGroupsClient.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.maintenance.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.maintenance.fluent.models.ApplyUpdateInner; + +/** + * An instance of this class provides access to all the operations defined in ApplyUpdateOperationGroupsClient. + */ +public interface ApplyUpdateOperationGroupsClient { + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @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 apply Update request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, Context context); + + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplyUpdateInner get(String resourceGroupName, String providerName, String resourceType, String resourceName, + String applyUpdateName); + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @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 apply Update request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, + Context context); + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplyUpdateInner createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate); + + /** + * Get Configuration records within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesClient.java index 3b5d20eceddf..6a81ff76d751 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesClient.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.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.maintenance.fluent.models.ApplyUpdateInner; @@ -16,17 +15,15 @@ */ public interface ApplyUpdatesClient { /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @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. @@ -39,17 +36,15 @@ Response getParentWithResponse(String resourceGroupName, Strin String applyUpdateName, Context context); /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -58,186 +53,4 @@ Response getParentWithResponse(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) ApplyUpdateInner getParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String applyUpdateName); - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, Context context); - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplyUpdateInner get(String resourceGroupName, String providerName, String resourceType, String resourceName, - String applyUpdateName); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @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 apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, - Context context); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplyUpdateInner createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate); - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @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 apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context); - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplyUpdateInner createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, - String resourceParentName, String resourceType, String resourceName); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @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 apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplyUpdateInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, - String resourceName); - - /** - * Get Configuration records within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get Configuration records within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesOperationGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesOperationGroupsClient.java new file mode 100644 index 000000000000..b0ca88aeae6d --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ApplyUpdatesOperationGroupsClient.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.util.Context; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroupsCreateOrUpdateResponse; + +/** + * An instance of this class provides access to all the operations defined in ApplyUpdatesOperationGroupsClient. + */ +public interface ApplyUpdatesOperationGroupsClient { + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @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 apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse createOrUpdateParentWithResponse(String resourceGroupName, + String providerName, String resourceParentType, String resourceParentName, String resourceType, + String resourceName, Context context); + + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplyUpdateInner createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, + String resourceParentName, String resourceType, String resourceName); + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @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 apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplyUpdatesOperationGroupsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, + String providerName, String resourceType, String resourceName, Context context); + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplyUpdateInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, + String resourceName); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsForResourceGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentForResourceGroupOperationGroupsClient.java similarity index 60% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsForResourceGroupsClient.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentForResourceGroupOperationGroupsClient.java index 95098a0b6001..0b765fa91c0e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsForResourceGroupsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentForResourceGroupOperationGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -8,17 +8,20 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; /** * An instance of this class provides access to all the operations defined in - * MaintenanceConfigurationsForResourceGroupsClient. + * ConfigurationAssignmentForResourceGroupOperationGroupsClient. */ -public interface MaintenanceConfigurationsForResourceGroupsClient { +public interface ConfigurationAssignmentForResourceGroupOperationGroupsClient { /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -26,12 +29,16 @@ public interface MaintenanceConfigurationsForResourceGroupsClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(String resourceGroupName, String providerName, String resourceType, + String resourceName); /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. * @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. @@ -40,5 +47,6 @@ public interface MaintenanceConfigurationsForResourceGroupsClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String providerName, String resourceType, + String resourceName, Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentOperationGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentOperationGroupsClient.java new file mode 100644 index 000000000000..3210246fe1d3 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentOperationGroupsClient.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.maintenance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; + +/** + * An instance of this class provides access to all the operations defined in + * ConfigurationAssignmentOperationGroupsClient. + */ +public interface ConfigurationAssignmentOperationGroupsClient { + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, Context context); + + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationAssignmentInner get(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName); + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment, Context context); + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, Context context); + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationAssignmentInner delete(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsClient.java index ca1038f018e7..22121660135c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -16,17 +16,15 @@ */ public interface ConfigurationAssignmentsClient { /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -39,17 +37,15 @@ Response getParentWithResponse(String resourceGrou String configurationAssignmentName, Context context); /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -60,17 +56,15 @@ ConfigurationAssignmentInner getParent(String resourceGroupName, String provider String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -85,17 +79,15 @@ Response createOrUpdateParentWithResponse(String r Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -108,17 +100,15 @@ ConfigurationAssignmentInner createOrUpdateParent(String resourceGroupName, Stri String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -131,17 +121,15 @@ Response deleteParentWithResponse(String resourceG String configurationAssignmentName, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -152,136 +140,14 @@ ConfigurationAssignmentInner deleteParent(String resourceGroupName, String provi String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName); /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context); - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationAssignmentInner get(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName); - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment, Context context); - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context); - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationAssignmentInner delete(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName); - - /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -292,16 +158,14 @@ PagedIterable listParent(String resourceGroupName, String resourceParentType, String resourceParentName, String resourceType, String resourceName); /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -312,41 +176,4 @@ PagedIterable listParent(String resourceGroupName, PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, Context context); - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String providerName, String resourceType, - String resourceName); - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String providerName, String resourceType, - String resourceName, Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForResourceGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForResourceGroupsClient.java index 8ef18df7e451..3437bb5f246c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForResourceGroupsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForResourceGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -16,12 +16,10 @@ */ public interface ConfigurationAssignmentsForResourceGroupsClient { /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -33,12 +31,10 @@ Response getByResourceGroupWithResponse(String res String configurationAssignmentName, Context context); /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -48,12 +44,10 @@ Response getByResourceGroupWithResponse(String res ConfigurationAssignmentInner getByResourceGroup(String resourceGroupName, String configurationAssignmentName); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -66,12 +60,10 @@ Response createOrUpdateWithResponse(String resourc String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -83,12 +75,10 @@ ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String con ConfigurationAssignmentInner configurationAssignment); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -101,12 +91,10 @@ Response updateWithResponse(String resourceGroupNa String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -118,12 +106,10 @@ ConfigurationAssignmentInner update(String resourceGroupName, String configurati ConfigurationAssignmentInner configurationAssignment); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -135,12 +121,10 @@ Response deleteWithResponse(String resourceGroupNa String configurationAssignmentName, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForSubscriptionsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForSubscriptionsClient.java index a5a37c3de95a..9a983ae3c2cf 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForSubscriptionsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsForSubscriptionsClient.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.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.maintenance.fluent.models.ConfigurationAssignmentInner; @@ -16,26 +17,22 @@ */ public interface ConfigurationAssignmentsForSubscriptionsClient { /** - * Get configuration assignment + * Get configuration assignment for resource. * - * Get configuration assignment for resource.. - * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. + * @return configuration assignment for resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String configurationAssignmentName, Context context); /** - * Get configuration assignment - * - * Get configuration assignment for resource.. + * Get configuration assignment for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -45,11 +42,9 @@ public interface ConfigurationAssignmentsForSubscriptionsClient { ConfigurationAssignmentInner get(String configurationAssignmentName); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -62,11 +57,9 @@ Response createOrUpdateWithResponse(String configu ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -78,11 +71,9 @@ ConfigurationAssignmentInner createOrUpdate(String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,11 +86,9 @@ Response updateWithResponse(String configurationAs ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -111,11 +100,9 @@ ConfigurationAssignmentInner update(String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -126,11 +113,9 @@ ConfigurationAssignmentInner update(String configurationAssignmentName, Response deleteWithResponse(String configurationAssignmentName, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -138,4 +123,26 @@ ConfigurationAssignmentInner update(String configurationAssignmentName, */ @ServiceMethod(returns = ReturnType.SINGLE) ConfigurationAssignmentInner delete(String configurationAssignmentName); + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsWithinSubscriptionsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsWithinSubscriptionsClient.java deleted file mode 100644 index 4767e097aa6e..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ConfigurationAssignmentsWithinSubscriptionsClient.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in - * ConfigurationAssignmentsWithinSubscriptionsClient. - */ -public interface ConfigurationAssignmentsWithinSubscriptionsClient { - /** - * Get configuration assignment within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get configuration assignment within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceManagementClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceClient.java similarity index 53% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceManagementClient.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceClient.java index 44724b1b49f8..9f2c3ce8d8ca 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceManagementClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for MaintenanceManagementClient class. + * The interface for MaintenanceClient class. */ -public interface MaintenanceManagementClient { +public interface MaintenanceClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -47,18 +47,25 @@ public interface MaintenanceManagementClient { Duration getDefaultPollInterval(); /** - * Gets the ScheduledEventsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ScheduledEventsClient object. + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. */ - ScheduledEventsClient getScheduledEvents(); + MaintenanceConfigurationsClient getMaintenanceConfigurations(); /** - * Gets the PublicMaintenanceConfigurationsClient object to access its operations. + * Gets the MaintenanceConfigurationOperationGroupsClient object to access its operations. * - * @return the PublicMaintenanceConfigurationsClient object. + * @return the MaintenanceConfigurationOperationGroupsClient object. */ - PublicMaintenanceConfigurationsClient getPublicMaintenanceConfigurations(); + MaintenanceConfigurationOperationGroupsClient getMaintenanceConfigurationOperationGroups(); /** * Gets the ApplyUpdatesClient object to access its operations. @@ -67,6 +74,13 @@ public interface MaintenanceManagementClient { */ ApplyUpdatesClient getApplyUpdates(); + /** + * Gets the ApplyUpdateOperationGroupsClient object to access its operations. + * + * @return the ApplyUpdateOperationGroupsClient object. + */ + ApplyUpdateOperationGroupsClient getApplyUpdateOperationGroups(); + /** * Gets the ConfigurationAssignmentsClient object to access its operations. * @@ -75,58 +89,59 @@ public interface MaintenanceManagementClient { ConfigurationAssignmentsClient getConfigurationAssignments(); /** - * Gets the MaintenanceConfigurationsClient object to access its operations. + * Gets the ConfigurationAssignmentOperationGroupsClient object to access its operations. * - * @return the MaintenanceConfigurationsClient object. + * @return the ConfigurationAssignmentOperationGroupsClient object. */ - MaintenanceConfigurationsClient getMaintenanceConfigurations(); + ConfigurationAssignmentOperationGroupsClient getConfigurationAssignmentOperationGroups(); /** - * Gets the MaintenanceConfigurationsForResourceGroupsClient object to access its operations. + * Gets the ConfigurationAssignmentsForSubscriptionsClient object to access its operations. * - * @return the MaintenanceConfigurationsForResourceGroupsClient object. + * @return the ConfigurationAssignmentsForSubscriptionsClient object. */ - MaintenanceConfigurationsForResourceGroupsClient getMaintenanceConfigurationsForResourceGroups(); + ConfigurationAssignmentsForSubscriptionsClient getConfigurationAssignmentsForSubscriptions(); /** - * Gets the ApplyUpdateForResourceGroupsClient object to access its operations. + * Gets the ConfigurationAssignmentsForResourceGroupsClient object to access its operations. * - * @return the ApplyUpdateForResourceGroupsClient object. + * @return the ConfigurationAssignmentsForResourceGroupsClient object. */ - ApplyUpdateForResourceGroupsClient getApplyUpdateForResourceGroups(); + ConfigurationAssignmentsForResourceGroupsClient getConfigurationAssignmentsForResourceGroups(); /** - * Gets the ConfigurationAssignmentsWithinSubscriptionsClient object to access its operations. + * Gets the ScheduledEventOperationGroupsClient object to access its operations. * - * @return the ConfigurationAssignmentsWithinSubscriptionsClient object. + * @return the ScheduledEventOperationGroupsClient object. */ - ConfigurationAssignmentsWithinSubscriptionsClient getConfigurationAssignmentsWithinSubscriptions(); + ScheduledEventOperationGroupsClient getScheduledEventOperationGroups(); /** - * Gets the ConfigurationAssignmentsForSubscriptionsClient object to access its operations. + * Gets the ApplyUpdatesOperationGroupsClient object to access its operations. * - * @return the ConfigurationAssignmentsForSubscriptionsClient object. + * @return the ApplyUpdatesOperationGroupsClient object. */ - ConfigurationAssignmentsForSubscriptionsClient getConfigurationAssignmentsForSubscriptions(); + ApplyUpdatesOperationGroupsClient getApplyUpdatesOperationGroups(); /** - * Gets the ConfigurationAssignmentsForResourceGroupsClient object to access its operations. + * Gets the ApplyUpdateForResourceGroupOperationGroupsClient object to access its operations. * - * @return the ConfigurationAssignmentsForResourceGroupsClient object. + * @return the ApplyUpdateForResourceGroupOperationGroupsClient object. */ - ConfigurationAssignmentsForResourceGroupsClient getConfigurationAssignmentsForResourceGroups(); + ApplyUpdateForResourceGroupOperationGroupsClient getApplyUpdateForResourceGroupOperationGroups(); /** - * Gets the OperationsClient object to access its operations. + * Gets the ConfigurationAssignmentForResourceGroupOperationGroupsClient object to access its operations. * - * @return the OperationsClient object. + * @return the ConfigurationAssignmentForResourceGroupOperationGroupsClient object. */ - OperationsClient getOperations(); + ConfigurationAssignmentForResourceGroupOperationGroupsClient + getConfigurationAssignmentForResourceGroupOperationGroups(); /** - * Gets the UpdatesClient object to access its operations. + * Gets the UpdatesOperationGroupsClient object to access its operations. * - * @return the UpdatesClient object. + * @return the UpdatesOperationGroupsClient object. */ - UpdatesClient getUpdates(); + UpdatesOperationGroupsClient getUpdatesOperationGroups(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationOperationGroupsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationOperationGroupsClient.java new file mode 100644 index 000000000000..3bc355dd1c55 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationOperationGroupsClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.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.maintenance.fluent.models.MaintenanceConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in + * MaintenanceConfigurationOperationGroupsClient. + */ +public interface MaintenanceConfigurationOperationGroupsClient { + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String resourceName, Context context); + + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Create or Update configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration, Context context); + + /** + * Create or Update configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner createOrUpdate(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration); + + /** + * Patch configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration, Context context); + + /** + * Patch configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner update(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration); + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @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 maintenance configuration record type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner delete(String resourceGroupName, String resourceName); + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get Configuration records within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsClient.java index 91dd2899bce3..af68fa51216c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/MaintenanceConfigurationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -16,141 +16,48 @@ */ public interface MaintenanceConfigurationsClient { /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response}. + * @return public Maintenance Configuration record along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String resourceName, Context context); + Response getWithResponse(String resourceName, Context context); /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record. + * @return public Maintenance Configuration record. */ @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceConfigurationInner getByResourceGroup(String resourceGroupName, String resourceName); + MaintenanceConfigurationInner get(String resourceName); /** - * Create or Update configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration, Context context); - - /** - * Create or Update configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceConfigurationInner createOrUpdate(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration); - - /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceConfigurationInner delete(String resourceGroupName, String resourceName); - - /** - * Patch configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration, Context context); - - /** - * Patch configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceConfigurationInner update(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration); - - /** - * Get Configuration records within a subscription. + * Get Public Maintenance Configuration records. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Get Configuration records within a subscription. + * Get Public Maintenance Configuration records. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/OperationsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/OperationsClient.java index cf1e21036b3f..271428a20628 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/OperationsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -17,7 +17,7 @@ public interface OperationsClient { /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -29,7 +29,7 @@ public interface OperationsClient { /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/PublicMaintenanceConfigurationsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/PublicMaintenanceConfigurationsClient.java deleted file mode 100644 index c1d8a1958caf..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/PublicMaintenanceConfigurationsClient.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.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.maintenance.fluent.models.MaintenanceConfigurationInner; - -/** - * An instance of this class provides access to all the operations defined in PublicMaintenanceConfigurationsClient. - */ -public interface PublicMaintenanceConfigurationsClient { - /** - * Get Public Maintenance Configuration records. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get Public Maintenance Configuration records. - * - * @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 public Maintenance Configuration records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceName, Context context); - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MaintenanceConfigurationInner get(String resourceName); -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ScheduledEventsClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ScheduledEventOperationGroupsClient.java similarity index 93% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ScheduledEventsClient.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ScheduledEventOperationGroupsClient.java index 19a008784e1e..276afbb25b0c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ScheduledEventsClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/ScheduledEventOperationGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -11,9 +11,9 @@ import com.azure.resourcemanager.maintenance.fluent.models.ScheduledEventApproveResponseInner; /** - * An instance of this class provides access to all the operations defined in ScheduledEventsClient. + * An instance of this class provides access to all the operations defined in ScheduledEventOperationGroupsClient. */ -public interface ScheduledEventsClient { +public interface ScheduledEventOperationGroupsClient { /** * Post Scheduled Event Acknowledgement. * diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/UpdatesClient.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/UpdatesOperationGroupsClient.java similarity index 79% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/UpdatesClient.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/UpdatesOperationGroupsClient.java index f50cdd3d7ad4..f4a4e913edc2 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/UpdatesClient.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/UpdatesOperationGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent; @@ -11,15 +11,15 @@ import com.azure.resourcemanager.maintenance.fluent.models.UpdateInner; /** - * An instance of this class provides access to all the operations defined in UpdatesClient. + * An instance of this class provides access to all the operations defined in UpdatesOperationGroupsClient. */ -public interface UpdatesClient { +public interface UpdatesOperationGroupsClient { /** * Get Updates to resource * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. * @param resourceParentName Resource parent identifier. @@ -28,7 +28,9 @@ public interface UpdatesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, @@ -39,7 +41,7 @@ PagedIterable listParent(String resourceGroupName, String providerN * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. * @param resourceParentName Resource parent identifier. @@ -49,7 +51,9 @@ PagedIterable listParent(String resourceGroupName, String providerN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, @@ -60,14 +64,16 @@ PagedIterable listParent(String resourceGroupName, String providerN * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceType Resource type. * @param resourceName Resource identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String providerName, String resourceType, @@ -78,7 +84,7 @@ PagedIterable list(String resourceGroupName, String providerName, S * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceType Resource type. * @param resourceName Resource identifier. @@ -86,7 +92,9 @@ PagedIterable list(String resourceGroupName, String providerName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String providerName, String resourceType, diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateInner.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateInner.java index 29d69ed11021..81c61b37d977 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateInner.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateProperties.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateProperties.java index 0957aab65cf3..23a6995ef01b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateProperties.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ApplyUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentInner.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentInner.java index 595fa95f9b38..e78788854e67 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentInner.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentProperties.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentProperties.java index c17174541ffd..a48f34334291 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentProperties.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ConfigurationAssignmentProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationInner.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationInner.java index 5b5b92414c6e..03e05016da25 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationInner.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationInner.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; +import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -20,17 +20,7 @@ * Maintenance configuration record type. */ @Fluent -public final class MaintenanceConfigurationInner extends ProxyResource { - /* - * Gets or sets location of the resource - */ - private String location; - - /* - * Gets or sets tags of the resource - */ - private Map tags; - +public final class MaintenanceConfigurationInner extends Resource { /* * Gets or sets properties of the resource */ @@ -62,46 +52,6 @@ public final class MaintenanceConfigurationInner extends ProxyResource { public MaintenanceConfigurationInner() { } - /** - * Get the location property: Gets or sets location of the resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Gets or sets location of the resource. - * - * @param location the location value to set. - * @return the MaintenanceConfigurationInner object itself. - */ - public MaintenanceConfigurationInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Gets or sets tags of the resource. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Gets or sets tags of the resource. - * - * @param tags the tags value to set. - * @return the MaintenanceConfigurationInner object itself. - */ - public MaintenanceConfigurationInner withTags(Map tags) { - this.tags = tags; - return this; - } - /** * Get the innerProperties property: Gets or sets properties of the resource. * @@ -150,6 +100,24 @@ public String id() { return this.id; } + /** + * {@inheritDoc} + */ + @Override + public MaintenanceConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public MaintenanceConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the namespace property: Gets or sets namespace of the resource. * @@ -433,8 +401,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -463,10 +431,10 @@ public static MaintenanceConfigurationInner fromJson(JsonReader jsonReader) thro } else if ("type".equals(fieldName)) { deserializedMaintenanceConfigurationInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedMaintenanceConfigurationInner.location = reader.getString(); + deserializedMaintenanceConfigurationInner.withLocation(reader.getString()); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedMaintenanceConfigurationInner.tags = tags; + deserializedMaintenanceConfigurationInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedMaintenanceConfigurationInner.innerProperties = MaintenanceConfigurationProperties.fromJson(reader); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationProperties.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationProperties.java index 997bffe11503..a6bdb461e10f 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationProperties.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceConfigurationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceWindow.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceWindow.java index 47f138c17d48..2377b190b812 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceWindow.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/MaintenanceWindow.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/OperationInner.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/OperationInner.java index d80003a07531..030a3119a414 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/OperationInner.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/OperationInner.java @@ -1,55 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.maintenance.models.OperationInfo; +import com.azure.resourcemanager.maintenance.models.ActionType; +import com.azure.resourcemanager.maintenance.models.OperationDisplay; +import com.azure.resourcemanager.maintenance.models.Origin; import java.io.IOException; /** - * Represents an operation returned by the GetOperations request. + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* - * Name of the operation + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * Display name of the operation + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ - private OperationInfo display; + private Boolean isDataAction; /* - * Origin of the operation + * Localized display information for this particular operation. */ - private String origin; + private OperationDisplay display; /* - * Properties of the operation + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ - private Object properties; + private Origin origin; /* - * Indicates whether the operation is a data action + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - private Boolean isDataAction; + private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Name of the operation. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -58,94 +66,42 @@ public String name() { } /** - * Set the name property: Name of the operation. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. * - * @param name the name value to set. - * @return the OperationInner object itself. + * @return the isDataAction value. */ - public OperationInner withName(String name) { - this.name = name; - return this; + public Boolean isDataAction() { + return this.isDataAction; } /** - * Get the display property: Display name of the operation. + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ - public OperationInfo display() { + public OperationDisplay display() { return this.display; } /** - * Set the display property: Display name of the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationInfo display) { - this.display = display; - return this; - } - - /** - * Get the origin property: Origin of the operation. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * * @return the origin value. */ - public String origin() { + public Origin origin() { return this.origin; } /** - * Set the origin property: Origin of the operation. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @param origin the origin value to set. - * @return the OperationInner object itself. + * @return the actionType value. */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get the properties property: Properties of the operation. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the operation. - * - * @param properties the properties value to set. - * @return the OperationInner object itself. - */ - public OperationInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation is a data action. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Indicates whether the operation is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationInner object itself. - */ - public OperationInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; + public ActionType actionType() { + return this.actionType; } /** @@ -165,11 +121,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); jsonWriter.writeJsonField("display", this.display); - jsonWriter.writeStringField("origin", this.origin); - jsonWriter.writeUntypedField("properties", this.properties); - jsonWriter.writeBooleanField("isDataAction", this.isDataAction); return jsonWriter.writeEndObject(); } @@ -190,14 +142,14 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedOperationInner.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationInfo.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedOperationInner.properties = reader.readUntyped(); } else if ("isDataAction".equals(fieldName)) { deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ScheduledEventApproveResponseInner.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ScheduledEventApproveResponseInner.java index 07b57d1cd739..86e6cc67ffbe 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ScheduledEventApproveResponseInner.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/ScheduledEventApproveResponseInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Response of scheduled event acknowledge. */ -@Fluent +@Immutable public final class ScheduledEventApproveResponseInner implements JsonSerializable { /* * Successfully Approved @@ -24,7 +24,7 @@ public final class ScheduledEventApproveResponseInner implements JsonSerializabl /** * Creates an instance of ScheduledEventApproveResponseInner class. */ - public ScheduledEventApproveResponseInner() { + private ScheduledEventApproveResponseInner() { } /** @@ -36,17 +36,6 @@ public String value() { return this.value; } - /** - * Set the value property: Successfully Approved. - * - * @param value the value value to set. - * @return the ScheduledEventApproveResponseInner object itself. - */ - public ScheduledEventApproveResponseInner withValue(String value) { - this.value = value; - return this; - } - /** * Validates the instance. * diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateInner.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateInner.java index e232c6d1634f..8e421dcd0572 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateInner.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -12,6 +12,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.maintenance.models.ImpactType; import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.UpdateProperties; import com.azure.resourcemanager.maintenance.models.UpdateStatus; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,7 +21,7 @@ /** * Maintenance update on a resource. */ -@Fluent +@Immutable public final class UpdateInner implements JsonSerializable { /* * The impact area @@ -50,12 +51,12 @@ public final class UpdateInner implements JsonSerializable { /* * Properties of the apply update */ - private UpdateProperties innerProperties; + private UpdateProperties properties; /** * Creates an instance of UpdateInner class. */ - public UpdateInner() { + private UpdateInner() { } /** @@ -67,17 +68,6 @@ public MaintenanceScope maintenanceScope() { return this.maintenanceScope; } - /** - * Set the maintenanceScope property: The impact area. - * - * @param maintenanceScope the maintenanceScope value to set. - * @return the UpdateInner object itself. - */ - public UpdateInner withMaintenanceScope(MaintenanceScope maintenanceScope) { - this.maintenanceScope = maintenanceScope; - return this; - } - /** * Get the impactType property: The impact type. * @@ -87,17 +77,6 @@ public ImpactType impactType() { return this.impactType; } - /** - * Set the impactType property: The impact type. - * - * @param impactType the impactType value to set. - * @return the UpdateInner object itself. - */ - public UpdateInner withImpactType(ImpactType impactType) { - this.impactType = impactType; - return this; - } - /** * Get the status property: The status. * @@ -107,17 +86,6 @@ public UpdateStatus status() { return this.status; } - /** - * Set the status property: The status. - * - * @param status the status value to set. - * @return the UpdateInner object itself. - */ - public UpdateInner withStatus(UpdateStatus status) { - this.status = status; - return this; - } - /** * Get the impactDurationInSec property: Duration of impact in seconds. * @@ -127,17 +95,6 @@ public Integer impactDurationInSec() { return this.impactDurationInSec; } - /** - * Set the impactDurationInSec property: Duration of impact in seconds. - * - * @param impactDurationInSec the impactDurationInSec value to set. - * @return the UpdateInner object itself. - */ - public UpdateInner withImpactDurationInSec(Integer impactDurationInSec) { - this.impactDurationInSec = impactDurationInSec; - return this; - } - /** * Get the notBefore property: Time when Azure will start force updates if not self-updated by customer before this * time. @@ -149,47 +106,12 @@ public OffsetDateTime notBefore() { } /** - * Set the notBefore property: Time when Azure will start force updates if not self-updated by customer before this - * time. - * - * @param notBefore the notBefore value to set. - * @return the UpdateInner object itself. - */ - public UpdateInner withNotBefore(OffsetDateTime notBefore) { - this.notBefore = notBefore; - return this; - } - - /** - * Get the innerProperties property: Properties of the apply update. - * - * @return the innerProperties value. - */ - private UpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the resourceId property: The resourceId. + * Get the properties property: Properties of the apply update. * - * @return the resourceId value. + * @return the properties value. */ - public String resourceId() { - return this.innerProperties() == null ? null : this.innerProperties().resourceId(); - } - - /** - * Set the resourceId property: The resourceId. - * - * @param resourceId the resourceId value to set. - * @return the UpdateInner object itself. - */ - public UpdateInner withResourceId(String resourceId) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateProperties(); - } - this.innerProperties().withResourceId(resourceId); - return this; + public UpdateProperties properties() { + return this.properties; } /** @@ -198,8 +120,8 @@ public UpdateInner withResourceId(String resourceId) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } @@ -216,7 +138,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("impactDurationInSec", this.impactDurationInSec); jsonWriter.writeStringField("notBefore", this.notBefore == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.notBefore)); - jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -247,7 +169,7 @@ public static UpdateInner fromJson(JsonReader jsonReader) throws IOException { deserializedUpdateInner.notBefore = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("properties".equals(fieldName)) { - deserializedUpdateInner.innerProperties = UpdateProperties.fromJson(reader); + deserializedUpdateInner.properties = UpdateProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/package-info.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/package-info.java index de40e85d0b54..f56998b41bd1 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/package-info.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for MaintenanceManagementClient. + * Package containing the inner data models for Maintenance. * Azure Maintenance Management Client. */ package com.azure.resourcemanager.maintenance.fluent.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/package-info.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/package-info.java index ea1c32771e96..d04350bf4f2e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/package-info.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for MaintenanceManagementClient. + * Package containing the service clients for Maintenance. * Azure Maintenance Management Client. */ package com.azure.resourcemanager.maintenance.fluent; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupOperationGroupsClientImpl.java new file mode 100644 index 000000000000..2ecb9247a5d6 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupOperationGroupsClientImpl.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.maintenance.fluent.ApplyUpdateForResourceGroupOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.implementation.models.ListApplyUpdate; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ApplyUpdateForResourceGroupOperationGroupsClient. + */ +public final class ApplyUpdateForResourceGroupOperationGroupsClientImpl + implements ApplyUpdateForResourceGroupOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApplyUpdateForResourceGroupOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of ApplyUpdateForResourceGroupOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplyUpdateForResourceGroupOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(ApplyUpdateForResourceGroupOperationGroupsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MaintenanceClientApplyUpdateForResourceGroupOperationGroups to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientApp") + public interface ApplyUpdateForResourceGroupOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/applyUpdates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/applyUpdates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @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); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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(), + this.client.getSubscriptionId(), resourceGroupName, 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 Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get Configuration records within a subscription and resource group + * + * 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 response for ApplyUpdate list 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 Configuration records within a subscription and resource group + * + * 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 response for ApplyUpdate list 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 Configuration records within a subscription and resource group + * + * 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 response for ApplyUpdate list 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(ApplyUpdateForResourceGroupOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupOperationGroupsImpl.java similarity index 74% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupsImpl.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupOperationGroupsImpl.java index d4916d485545..43b4d87f8889 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupOperationGroupsImpl.java @@ -1,25 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.maintenance.fluent.ApplyUpdateForResourceGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.ApplyUpdateForResourceGroupOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; -import com.azure.resourcemanager.maintenance.models.ApplyUpdateForResourceGroups; +import com.azure.resourcemanager.maintenance.models.ApplyUpdateForResourceGroupOperationGroups; -public final class ApplyUpdateForResourceGroupsImpl implements ApplyUpdateForResourceGroups { - private static final ClientLogger LOGGER = new ClientLogger(ApplyUpdateForResourceGroupsImpl.class); +public final class ApplyUpdateForResourceGroupOperationGroupsImpl + implements ApplyUpdateForResourceGroupOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(ApplyUpdateForResourceGroupOperationGroupsImpl.class); - private final ApplyUpdateForResourceGroupsClient innerClient; + private final ApplyUpdateForResourceGroupOperationGroupsClient innerClient; private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; - public ApplyUpdateForResourceGroupsImpl(ApplyUpdateForResourceGroupsClient innerClient, + public ApplyUpdateForResourceGroupOperationGroupsImpl(ApplyUpdateForResourceGroupOperationGroupsClient innerClient, com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -35,7 +36,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplyUpdateImpl(inner1, this.manager())); } - private ApplyUpdateForResourceGroupsClient serviceClient() { + private ApplyUpdateForResourceGroupOperationGroupsClient serviceClient() { return this.innerClient; } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupsClientImpl.java deleted file mode 100644 index b96cb67c4a2f..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateForResourceGroupsClientImpl.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.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.resourcemanager.maintenance.fluent.ApplyUpdateForResourceGroupsClient; -import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; -import com.azure.resourcemanager.maintenance.models.ListApplyUpdate; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ApplyUpdateForResourceGroupsClient. - */ -public final class ApplyUpdateForResourceGroupsClientImpl implements ApplyUpdateForResourceGroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ApplyUpdateForResourceGroupsService service; - - /** - * The service client containing this operation class. - */ - private final MaintenanceManagementClientImpl client; - - /** - * Initializes an instance of ApplyUpdateForResourceGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplyUpdateForResourceGroupsClientImpl(MaintenanceManagementClientImpl client) { - this.service = RestProxy.create(ApplyUpdateForResourceGroupsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MaintenanceManagementClientApplyUpdateForResourceGroups to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") - public interface ApplyUpdateForResourceGroupsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/applyUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateImpl.java index 8b5e490e8acc..16309f2033dc 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateOperationGroupsClientImpl.java new file mode 100644 index 000000000000..f5289e752c41 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateOperationGroupsClientImpl.java @@ -0,0 +1,643 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.maintenance.fluent.ApplyUpdateOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.implementation.models.ListApplyUpdate; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ApplyUpdateOperationGroupsClient. + */ +public final class ApplyUpdateOperationGroupsClientImpl implements ApplyUpdateOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApplyUpdateOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of ApplyUpdateOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplyUpdateOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(ApplyUpdateOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MaintenanceClientApplyUpdateOperationGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientApp") + public interface ApplyUpdateOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("applyUpdateName") String applyUpdateName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("applyUpdateName") String applyUpdateName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateOrCancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("applyUpdateName") String applyUpdateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplyUpdateInner applyUpdate, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateOrCancelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("applyUpdateName") String applyUpdateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplyUpdateInner applyUpdate, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/applyUpdates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/applyUpdates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @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); + } + + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (applyUpdateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applyUpdateName 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, providerName, resourceType, resourceName, + applyUpdateName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName) { + return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (applyUpdateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, accept, context); + } + + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplyUpdateInner get(String resourceGroupName, String providerName, String resourceType, String resourceName, + String applyUpdateName) { + return getWithResponse(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, + Context.NONE).getValue(); + } + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateOrCancelWithResponseAsync(String resourceGroupName, + String providerName, String resourceType, String resourceName, String applyUpdateName, + ApplyUpdateInner applyUpdate) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (applyUpdateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); + } + if (applyUpdate == null) { + return Mono.error(new IllegalArgumentException("Parameter applyUpdate is required and cannot be null.")); + } else { + applyUpdate.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateOrCancel(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, providerName, + resourceType, resourceName, applyUpdateName, contentType, accept, applyUpdate, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateOrCancelAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate) { + return createOrUpdateOrCancelWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, + applyUpdateName, applyUpdate).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, + 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (applyUpdateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); + } + if (applyUpdate == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applyUpdate is required and cannot be null.")); + } else { + applyUpdate.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateOrCancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, + applyUpdateName, contentType, accept, applyUpdate, context); + } + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplyUpdateInner createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate) { + return createOrUpdateOrCancelWithResponse(resourceGroupName, providerName, resourceType, resourceName, + applyUpdateName, applyUpdate, Context.NONE).getValue(); + } + + /** + * Get Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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(), + this.client.getSubscriptionId(), 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 Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplyUpdate list 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 response for ApplyUpdate list 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 response for ApplyUpdate list 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(ApplyUpdateOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateOperationGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateOperationGroupsImpl.java new file mode 100644 index 000000000000..97e03f66cea0 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdateOperationGroupsImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.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.maintenance.fluent.ApplyUpdateOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.models.ApplyUpdate; +import com.azure.resourcemanager.maintenance.models.ApplyUpdateOperationGroups; + +public final class ApplyUpdateOperationGroupsImpl implements ApplyUpdateOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(ApplyUpdateOperationGroupsImpl.class); + + private final ApplyUpdateOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; + + public ApplyUpdateOperationGroupsImpl(ApplyUpdateOperationGroupsClient innerClient, + com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplyUpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplyUpdate get(String resourceGroupName, String providerName, String resourceType, String resourceName, + String applyUpdateName) { + ApplyUpdateInner inner + = this.serviceClient().get(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName); + if (inner != null) { + return new ApplyUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, + Context context) { + Response inner = this.serviceClient() + .createOrUpdateOrCancelWithResponse(resourceGroupName, providerName, resourceType, resourceName, + applyUpdateName, applyUpdate, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplyUpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplyUpdate createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate) { + ApplyUpdateInner inner = this.serviceClient() + .createOrUpdateOrCancel(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, + applyUpdate); + if (inner != null) { + return new ApplyUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplyUpdateImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplyUpdateImpl(inner1, this.manager())); + } + + private ApplyUpdateOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesClientImpl.java index e08cbe1e6afa..0e25f0ea2313 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesClientImpl.java @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.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; @@ -12,24 +11,19 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.maintenance.fluent.ApplyUpdatesClient; import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; -import com.azure.resourcemanager.maintenance.models.ListApplyUpdate; import reactor.core.publisher.Mono; /** @@ -44,104 +38,61 @@ public final class ApplyUpdatesClientImpl implements ApplyUpdatesClient { /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** * Initializes an instance of ApplyUpdatesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ApplyUpdatesClientImpl(MaintenanceManagementClientImpl client) { + ApplyUpdatesClientImpl(MaintenanceClientImpl client) { this.service = RestProxy.create(ApplyUpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientApplyUpdates to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for MaintenanceClientApplyUpdates to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientApp") public interface ApplyUpdatesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, @PathParam("resourceParentType") String resourceParentType, @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("applyUpdateName") String applyUpdateName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, - @PathParam("applyUpdateName") String applyUpdateName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateOrCancel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, - @PathParam("applyUpdateName") String applyUpdateName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ApplyUpdateInner applyUpdate, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, @PathParam("resourceParentType") String resourceParentType, @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/applyUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceName") String resourceName, @PathParam("applyUpdateName") String applyUpdateName, @HeaderParam("Accept") String accept, Context context); } /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -186,86 +137,22 @@ private Mono> getParentWithResponseAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - applyUpdateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, applyUpdateName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Track Updates to resource with parent - * - * Track maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getParentWithResponseAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - String applyUpdateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); - } - if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (applyUpdateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceParentType, resourceParentName, resourceType, resourceName, applyUpdateName, - this.client.getApiVersion(), accept, context); - } - - /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -280,17 +167,15 @@ private Mono getParentAsync(String resourceGroupName, String p } /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -301,834 +186,71 @@ private Mono getParentAsync(String resourceGroupName, String p public Response getParentWithResponse(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String applyUpdateName, Context context) { - return getParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, applyUpdateName, context).block(); - } - - /** - * Track Updates to resource with parent - * - * Track maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplyUpdateInner getParent(String resourceGroupName, String providerName, String resourceParentType, - String resourceParentName, String resourceType, String resourceName, String applyUpdateName) { - return getParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, applyUpdateName, Context.NONE).getValue(); - } - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (applyUpdateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + if (resourceParentType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + if (resourceParentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); } if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); } if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (applyUpdateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName, - resourceType, resourceName, applyUpdateName, this.client.getApiVersion(), accept, context); - } - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName) { - return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return service.getParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, applyUpdateName, accept, context); } /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, Context context) { - return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, - context).block(); - } - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. + * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return apply Update request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApplyUpdateInner get(String resourceGroupName, String providerName, String resourceType, String resourceName, - String applyUpdateName) { - return getWithResponse(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, - Context.NONE).getValue(); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateOrCancelWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String applyUpdateName, - ApplyUpdateInner applyUpdate) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (applyUpdateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); - } - if (applyUpdate == null) { - return Mono.error(new IllegalArgumentException("Parameter applyUpdate is required and cannot be null.")); - } else { - applyUpdate.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdateOrCancel(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, - applyUpdateName, this.client.getApiVersion(), applyUpdate, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public ApplyUpdateInner getParent(String resourceGroupName, String providerName, String resourceParentType, + String resourceParentName, String resourceType, String resourceName, String applyUpdateName) { + return getParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, applyUpdateName, Context.NONE).getValue(); } - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateOrCancelWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String applyUpdateName, - ApplyUpdateInner applyUpdate, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (applyUpdateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.")); - } - if (applyUpdate == null) { - return Mono.error(new IllegalArgumentException("Parameter applyUpdate is required and cannot be null.")); - } else { - applyUpdate.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateOrCancel(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, this.client.getApiVersion(), - applyUpdate, accept, context); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateOrCancelAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate) { - return createOrUpdateOrCancelWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - applyUpdateName, applyUpdate).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, - Context context) { - return createOrUpdateOrCancelWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - applyUpdateName, applyUpdate, context).block(); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplyUpdateInner createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate) { - return createOrUpdateOrCancelWithResponse(resourceGroupName, providerName, resourceType, resourceName, - applyUpdateName, applyUpdate, Context.NONE).getValue(); - } - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateParentWithResponseAsync(String resourceGroupName, - String providerName, String resourceParentType, String resourceParentName, String resourceType, - String resourceName) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); - } - if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdateParent(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateParentWithResponseAsync(String resourceGroupName, - String providerName, String resourceParentType, String resourceParentName, String resourceType, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); - } - if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - this.client.getApiVersion(), accept, context); - } - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateParentAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context) { - return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, context).block(); - } - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplyUpdateInner createOrUpdateParent(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - return createOrUpdateParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, Context.NONE).getValue(); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceType, resourceName, this.client.getApiVersion(), accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceType, resourceName, this.client.getApiVersion(), accept, context); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName) { - return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, context) - .block(); - } - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplyUpdateInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, - String resourceName) { - return createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, Context.NONE) - .getValue(); - } - - /** - * Get Configuration records within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Configuration records within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get Configuration records within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get Configuration records within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get Configuration records within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get Configuration records within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } + private static final ClientLogger LOGGER = new ClientLogger(ApplyUpdatesClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesImpl.java index 36eeed461c5a..d47d5a1acd9e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesImpl.java @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.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; @@ -53,114 +52,6 @@ public ApplyUpdate getParent(String resourceGroupName, String providerName, Stri } } - public Response getWithResponse(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplyUpdateImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApplyUpdate get(String resourceGroupName, String providerName, String resourceType, String resourceName, - String applyUpdateName) { - ApplyUpdateInner inner - = this.serviceClient().get(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName); - if (inner != null) { - return new ApplyUpdateImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, - Context context) { - Response inner = this.serviceClient() - .createOrUpdateOrCancelWithResponse(resourceGroupName, providerName, resourceType, resourceName, - applyUpdateName, applyUpdate, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplyUpdateImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApplyUpdate createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate) { - ApplyUpdateInner inner = this.serviceClient() - .createOrUpdateOrCancel(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, - applyUpdate); - if (inner != null) { - return new ApplyUpdateImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context) { - Response inner = this.serviceClient() - .createOrUpdateParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplyUpdateImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApplyUpdate createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, - String resourceParentName, String resourceType, String resourceName) { - ApplyUpdateInner inner = this.serviceClient() - .createOrUpdateParent(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, - resourceName); - if (inner != null) { - return new ApplyUpdateImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplyUpdateImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApplyUpdate createOrUpdate(String resourceGroupName, String providerName, String resourceType, - String resourceName) { - ApplyUpdateInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, providerName, resourceType, resourceName); - if (inner != null) { - return new ApplyUpdateImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplyUpdateImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplyUpdateImpl(inner1, this.manager())); - } - private ApplyUpdatesClient serviceClient() { return this.innerClient; } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesOperationGroupsClientImpl.java new file mode 100644 index 000000000000..070224bfa8a2 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesOperationGroupsClientImpl.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.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.maintenance.fluent.ApplyUpdatesOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroupsCreateOrUpdateResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ApplyUpdatesOperationGroupsClient. + */ +public final class ApplyUpdatesOperationGroupsClientImpl implements ApplyUpdatesOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApplyUpdatesOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of ApplyUpdatesOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplyUpdatesOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(ApplyUpdatesOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MaintenanceClientApplyUpdatesOperationGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientApp") + public interface ApplyUpdatesOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdateParent( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse createOrUpdateParentSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + ApplyUpdatesOperationGroupsCreateOrUpdateResponse createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateParentWithResponseAsync( + String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, + String resourceType, String resourceName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceParentType == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateParentAsync(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse createOrUpdateParentWithResponse( + String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, + String resourceType, String resourceName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceParentType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.createOrUpdateParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, accept, context); + } + + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplyUpdateInner createOrUpdateParent(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + return createOrUpdateParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, Context.NONE).getValue(); + } + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync( + String resourceGroupName, String providerName, String resourceType, String resourceName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplyUpdatesOperationGroupsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, + String providerName, String resourceType, String resourceName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, accept, + context); + } + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplyUpdateInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, + String resourceName) { + return createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, Context.NONE) + .getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplyUpdatesOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesOperationGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesOperationGroupsImpl.java new file mode 100644 index 000000000000..464a88351c9a --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ApplyUpdatesOperationGroupsImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.maintenance.fluent.ApplyUpdatesOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; +import com.azure.resourcemanager.maintenance.models.ApplyUpdate; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroups; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse; +import com.azure.resourcemanager.maintenance.models.ApplyUpdatesOperationGroupsCreateOrUpdateResponse; + +public final class ApplyUpdatesOperationGroupsImpl implements ApplyUpdatesOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(ApplyUpdatesOperationGroupsImpl.class); + + private final ApplyUpdatesOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; + + public ApplyUpdatesOperationGroupsImpl(ApplyUpdatesOperationGroupsClient innerClient, + com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName, + Context context) { + ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse inner = this.serviceClient() + .createOrUpdateParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplyUpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplyUpdate createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, + String resourceParentName, String resourceType, String resourceName) { + ApplyUpdateInner inner = this.serviceClient() + .createOrUpdateParent(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, + resourceName); + if (inner != null) { + return new ApplyUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, Context context) { + ApplyUpdatesOperationGroupsCreateOrUpdateResponse inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplyUpdateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplyUpdate createOrUpdate(String resourceGroupName, String providerName, String resourceType, + String resourceName) { + ApplyUpdateInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, providerName, resourceType, resourceName); + if (inner != null) { + return new ApplyUpdateImpl(inner, this.manager()); + } else { + return null; + } + } + + private ApplyUpdatesOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl.java new file mode 100644 index 000000000000..c1226faaf8c2 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.maintenance.fluent.ConfigurationAssignmentForResourceGroupOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.implementation.models.ListConfigurationAssignmentsResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ConfigurationAssignmentForResourceGroupOperationGroupsClient. + */ +public final class ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl + implements ConfigurationAssignmentForResourceGroupOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConfigurationAssignmentForResourceGroupOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(ConfigurationAssignmentForResourceGroupOperationGroupsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * MaintenanceClientConfigurationAssignmentForResourceGroupOperationGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientCon") + public interface ConfigurationAssignmentForResourceGroupOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @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); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String providerName, String resourceType, String resourceName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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, providerName, resourceType, resourceName, 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 Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName 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, providerName, resourceType, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String providerName, + String resourceType, String resourceName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName 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, providerName, resourceType, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, providerName, resourceType, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String providerName, + String resourceType, String resourceName, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, providerName, resourceType, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get Configuration records within a subscription and resource group + * + * 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 response for ConfigurationAssignments list 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 Configuration records within a subscription and resource group + * + * 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 response for ConfigurationAssignments list 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 Configuration records within a subscription and resource group + * + * 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 response for ConfigurationAssignments list 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(ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentForResourceGroupOperationGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentForResourceGroupOperationGroupsImpl.java new file mode 100644 index 000000000000..589aae9568b2 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentForResourceGroupOperationGroupsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentForResourceGroupOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentForResourceGroupOperationGroups; + +public final class ConfigurationAssignmentForResourceGroupOperationGroupsImpl + implements ConfigurationAssignmentForResourceGroupOperationGroups { + private static final ClientLogger LOGGER + = new ClientLogger(ConfigurationAssignmentForResourceGroupOperationGroupsImpl.class); + + private final ConfigurationAssignmentForResourceGroupOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; + + public ConfigurationAssignmentForResourceGroupOperationGroupsImpl( + ConfigurationAssignmentForResourceGroupOperationGroupsClient innerClient, + com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, providerName, resourceType, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String providerName, + String resourceType, String resourceName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, providerName, resourceType, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); + } + + private ConfigurationAssignmentForResourceGroupOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentImpl.java index d87dee170af1..7909e24f6aa7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentOperationGroupsClientImpl.java new file mode 100644 index 000000000000..a9f045e8c9cc --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentOperationGroupsClientImpl.java @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.maintenance.fluent.ConfigurationAssignmentOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ConfigurationAssignmentOperationGroupsClient. + */ +public final class ConfigurationAssignmentOperationGroupsClientImpl + implements ConfigurationAssignmentOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConfigurationAssignmentOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of ConfigurationAssignmentOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationAssignmentOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(ConfigurationAssignmentOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MaintenanceClientConfigurationAssignmentOperationGroups to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientCon") + public interface ConfigurationAssignmentOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String providerName, String resourceType, String resourceName, String configurationAssignmentName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationAssignmentName 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, providerName, resourceType, resourceName, + configurationAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName) { + return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, accept, context); + } + + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationAssignmentInner get(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName) { + return getWithResponse(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, + Context.NONE).getValue(); + } + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String providerName, String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); + } + if (configurationAssignment == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + } else { + configurationAssignment.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, providerName, resourceType, resourceName, + configurationAssignmentName, contentType, accept, configurationAssignment, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment) { + return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, configurationAssignment).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String providerName, String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + if (configurationAssignment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + } else { + configurationAssignment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, contentType, accept, configurationAssignment, context); + } + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment) { + return createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, configurationAssignment, Context.NONE).getValue(); + } + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, + String providerName, String resourceType, String resourceName, String configurationAssignmentName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName) { + return deleteWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, accept, context); + } + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationAssignmentInner delete(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName) { + return deleteWithResponse(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAssignmentOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentOperationGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentOperationGroupsImpl.java new file mode 100644 index 000000000000..44eaef0ce1a4 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentOperationGroupsImpl.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentOperationGroups; + +public final class ConfigurationAssignmentOperationGroupsImpl implements ConfigurationAssignmentOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAssignmentOperationGroupsImpl.class); + + private final ConfigurationAssignmentOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; + + public ConfigurationAssignmentOperationGroupsImpl(ConfigurationAssignmentOperationGroupsClient innerClient, + com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigurationAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationAssignment get(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName) { + ConfigurationAssignmentInner inner = this.serviceClient() + .get(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName); + if (inner != null) { + return new ConfigurationAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, configurationAssignment, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigurationAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationAssignment createOrUpdate(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) { + ConfigurationAssignmentInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, + configurationAssignment); + if (inner != null) { + return new ConfigurationAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, Context context) { + Response inner = this.serviceClient() + .deleteWithResponse(resourceGroupName, providerName, resourceType, resourceName, + configurationAssignmentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigurationAssignmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationAssignment delete(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName) { + ConfigurationAssignmentInner inner = this.serviceClient() + .delete(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName); + if (inner != null) { + return new ConfigurationAssignmentImpl(inner, this.manager()); + } else { + return null; + } + } + + private ConfigurationAssignmentOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsClientImpl.java index 8c91d3c1672d..8b1fab641913 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -28,9 +28,10 @@ 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.maintenance.fluent.ConfigurationAssignmentsClient; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ListConfigurationAssignmentsResult; +import com.azure.resourcemanager.maintenance.implementation.models.ListConfigurationAssignmentsResult; import reactor.core.publisher.Mono; /** @@ -45,137 +46,153 @@ public final class ConfigurationAssignmentsClientImpl implements ConfigurationAs /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** * Initializes an instance of ConfigurationAssignmentsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ConfigurationAssignmentsClientImpl(MaintenanceManagementClientImpl client) { + ConfigurationAssignmentsClientImpl(MaintenanceClientImpl client) { this.service = RestProxy.create(ConfigurationAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientConfigurationAssignments to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for MaintenanceClientConfigurationAssignments to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientCon") public interface ConfigurationAssignmentsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, @PathParam("resourceParentType") String resourceParentType, @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, @PathParam("resourceParentType") String resourceParentType, @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdateParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, @PathParam("resourceParentType") String resourceParentType, @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") - @ExpectedResponses({ 200, 201 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> deleteParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, @PathParam("resourceParentType") String resourceParentType, @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listParentNext( + @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 listParentNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -221,87 +238,22 @@ private Mono> getParentWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - configurationAssignmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, configurationAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getParentWithResponseAsync(String resourceGroupName, - String providerName, String resourceParentType, String resourceParentName, String resourceType, - String resourceName, String configurationAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); - } - if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceParentType, resourceParentName, resourceType, resourceName, - configurationAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -316,17 +268,15 @@ private Mono getParentAsync(String resourceGroupNa } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -337,22 +287,61 @@ private Mono getParentAsync(String resourceGroupNa public Response getParentWithResponse(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, Context context) { - return getParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, configurationAssignmentName, context).block(); + 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceParentType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, configurationAssignmentName, accept, context); } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -367,17 +356,15 @@ public ConfigurationAssignmentInner getParent(String resourceGroupName, String p } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -427,153 +414,126 @@ private Mono> createOrUpdateParentWithRes } else { configurationAssignment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrUpdateParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context)) + .withContext(context -> service.createOrUpdateParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, configurationAssignmentName, contentType, accept, + configurationAssignment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create configuration assignment + * Register configuration for resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent name. + * @param resourceType Resource type. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateParentAsync(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName, + String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) { + return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. + * @return configuration Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateParentWithResponseAsync(String resourceGroupName, + public Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); } if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); } if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); } if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); } if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); } if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); } else { configurationAssignment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateParentAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) { - return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateParentWithResponse(String resourceGroupName, - String providerName, String resourceParentType, String resourceParentName, String resourceType, - String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, - Context context) { - return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment, - context).block(); + return service.createOrUpdateParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, configurationAssignmentName, contentType, accept, configurationAssignment, + context); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -589,17 +549,15 @@ public ConfigurationAssignmentInner createOrUpdateParent(String resourceGroupNam } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -644,583 +602,142 @@ private Mono> deleteParentWithResponseAsy } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - configurationAssignmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deleteParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, configurationAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Unregister configuration for resource + * Unregister configuration for resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent name. + * @param resourceType Resource type. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteParentAsync(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName, + String configurationAssignmentName) { + return deleteParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. + * @return configuration Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteParentWithResponseAsync(String resourceGroupName, + public Response deleteParentWithResponse(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); } if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); } if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); } if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); } if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceParentType, resourceParentName, resourceType, resourceName, - configurationAssignmentName, this.client.getApiVersion(), accept, context); + return service.deleteParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, configurationAssignmentName, accept, context); } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment on successful completion of {@link Mono}. + * @return configuration Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteParentAsync(String resourceGroupName, String providerName, + public ConfigurationAssignmentInner deleteParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName) { - return deleteParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return deleteParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, configurationAssignmentName, Context.NONE).getValue(); } /** - * Unregister configuration for resource - * - * Unregister configuration for resource. + * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @param context The context to associate with this operation. + * @param resourceName Resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. + * @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteParentWithResponse(String resourceGroupName, + private Mono> listParentSinglePageAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, - String resourceName, String configurationAssignmentName, Context context) { - return deleteParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, configurationAssignmentName, context).block(); - } - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationAssignmentInner deleteParent(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - String configurationAssignmentName) { - return deleteParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName, - resourceType, resourceName, configurationAssignmentName, Context.NONE).getValue(); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName, - resourceType, resourceName, configurationAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName) { - return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context) { - return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, context).block(); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationAssignmentInner get(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName) { - return getWithResponse(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, - Context.NONE).getValue(); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); - } else { - configurationAssignment.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, - this.client.getApiVersion(), configurationAssignment, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); - } else { - configurationAssignment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceType, resourceName, configurationAssignmentName, this.client.getApiVersion(), - configurationAssignment, accept, context); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment) { - return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, configurationAssignment).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, configurationAssignment, context).block(); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment) { - return createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, configurationAssignment, Context.NONE).getValue(); - } - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, String configurationAssignmentName, - Context context) { + String resourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1236,270 +753,181 @@ private Mono> deleteWithResponseAsync(Str if (providerName == null) { return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); } + if (resourceParentType == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } if (resourceType == null) { return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); } if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceType, resourceName, configurationAssignmentName, this.client.getApiVersion(), accept, - context); - } - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName) { - return deleteWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, context).block(); + return FluxUtil + .withContext(context -> service.listParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, 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())); } /** - * Unregister configuration for resource - * - * Unregister configuration for resource. + * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationAssignmentInner delete(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName) { - return deleteWithResponse(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listParentAsync(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName), nextLink -> listParentNextSinglePageAsync(nextLink)); } /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listParentSinglePageAsync(String resourceGroupName, + private PagedResponse listParentSinglePage(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); } if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); } if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); } if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); } if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listParentSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, providerName, + resourceParentType, resourceParentName, resourceType, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listParentSinglePageAsync(String resourceGroupName, + private PagedResponse listParentSinglePage(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); } if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); } if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); } if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); } if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName, - resourceParentType, resourceParentName, resourceType, resourceName, this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listParentAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName)); - } - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listParentAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context) { - return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, context)); + Response res = service.listParentSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, providerName, + resourceParentType, resourceParentName, resourceType, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1508,21 +936,19 @@ private PagedFlux listParentAsync(String resourceG @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - return new PagedIterable<>(listParentAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName)); + return new PagedIterable<>(() -> listParentSinglePage(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName), nextLink -> listParentNextSinglePage(nextLink)); } /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1533,19 +959,15 @@ public PagedIterable listParent(String resourceGro public PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, Context context) { - return new PagedIterable<>(listParentAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, context)); + return new PagedIterable<>(() -> listParentSinglePage(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, context), + nextLink -> listParentNextSinglePage(nextLink, context)); } /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. + * Get the next page of items. * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @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. @@ -1553,168 +975,76 @@ public PagedIterable listParent(String resourceGro * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName) { + private Mono> listParentNextSinglePageAsync(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.")); } - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceType, resourceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listParentNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List configurationAssignments for resource + * Get the next page of items. * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. + * @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 response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String providerName, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + private PagedResponse listParentNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName 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"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName, - resourceType, resourceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName)); + Response res + = service.listParentNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. + * Get the next page of items. * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @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 response for ConfigurationAssignments list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName, context)); - } - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String providerName, - String resourceType, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, providerName, resourceType, resourceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listParentNextSinglePage(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.listParentNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, providerName, resourceType, resourceName, context)); - } + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAssignmentsClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsClientImpl.java index d1ccf218b967..7519ab46078e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -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.maintenance.fluent.ConfigurationAssignmentsForResourceGroupsClient; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; import reactor.core.publisher.Mono; @@ -43,78 +44,112 @@ public final class ConfigurationAssignmentsForResourceGroupsClientImpl /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** * Initializes an instance of ConfigurationAssignmentsForResourceGroupsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ConfigurationAssignmentsForResourceGroupsClientImpl(MaintenanceManagementClientImpl client) { + ConfigurationAssignmentsForResourceGroupsClientImpl(MaintenanceClientImpl client) { this.service = RestProxy.create(ConfigurationAssignmentsForResourceGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientConfigurationAssignmentsForResourceGroups - * to be used by the proxy service to perform REST calls. + * The interface defining all the services for MaintenanceClientConfigurationAssignmentsForResourceGroups to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientCon") public interface ConfigurationAssignmentsForResourceGroupsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @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("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @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("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -142,58 +177,16 @@ private Mono> getByResourceGroupWithRespo } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, configurationAssignmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String configurationAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - configurationAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -207,12 +200,10 @@ private Mono getByResourceGroupAsync(String resour } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -222,16 +213,35 @@ private Mono getByResourceGroupAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String configurationAssignmentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, configurationAssignmentName, context).block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, accept, context); } /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -244,12 +254,10 @@ public ConfigurationAssignmentInner getByResourceGroup(String resourceGroupName, } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -281,66 +289,20 @@ private Mono> createOrUpdateWithResponseA } else { configurationAssignment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, contentType, accept, + configurationAssignment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); - } else { - configurationAssignment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -355,12 +317,10 @@ private Mono createOrUpdateAsync(String resourceGr } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -371,17 +331,43 @@ private Mono createOrUpdateAsync(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, configurationAssignmentName, configurationAssignment, - context).block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + if (configurationAssignment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + } else { + configurationAssignment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, contentType, accept, + configurationAssignment, context); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -396,12 +382,10 @@ public ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, Str } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -433,66 +417,20 @@ private Mono> updateWithResponseAsync(Str } else { configurationAssignment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, contentType, accept, + configurationAssignment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); - } else { - configurationAssignment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context); - } - - /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -507,12 +445,10 @@ private Mono updateAsync(String resourceGroupName, } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -523,17 +459,43 @@ private Mono updateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - return updateWithResponseAsync(resourceGroupName, configurationAssignmentName, configurationAssignment, context) - .block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + if (configurationAssignment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + } else { + configurationAssignment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, contentType, accept, + configurationAssignment, context); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -548,12 +510,10 @@ public ConfigurationAssignmentInner update(String resourceGroupName, String conf } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -580,56 +540,16 @@ private Mono> deleteWithResponseAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, configurationAssignmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, - String configurationAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - configurationAssignmentName, this.client.getApiVersion(), accept, context); - } - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -643,12 +563,10 @@ private Mono deleteAsync(String resourceGroupName, } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -658,16 +576,35 @@ private Mono deleteAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String configurationAssignmentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, configurationAssignmentName, context).block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, configurationAssignmentName, accept, context); } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -677,4 +614,7 @@ public Response deleteWithResponse(String resource public ConfigurationAssignmentInner delete(String resourceGroupName, String configurationAssignmentName) { return deleteWithResponse(resourceGroupName, configurationAssignmentName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER + = new ClientLogger(ConfigurationAssignmentsForResourceGroupsClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsImpl.java index 0724ae223652..7a5529661752 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForResourceGroupsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsClientImpl.java index 4c44994cc306..401ce4485190 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -20,13 +20,19 @@ 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.maintenance.fluent.ConfigurationAssignmentsForSubscriptionsClient; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.implementation.models.ListConfigurationAssignmentsResult; import reactor.core.publisher.Mono; /** @@ -43,77 +49,139 @@ public final class ConfigurationAssignmentsForSubscriptionsClientImpl /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** * Initializes an instance of ConfigurationAssignmentsForSubscriptionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ConfigurationAssignmentsForSubscriptionsClientImpl(MaintenanceManagementClientImpl client) { + ConfigurationAssignmentsForSubscriptionsClientImpl(MaintenanceClientImpl client) { this.service = RestProxy.create(ConfigurationAssignmentsForSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientConfigurationAssignmentsForSubscriptions - * to be used by the proxy service to perform REST calls. + * The interface defining all the services for MaintenanceClientConfigurationAssignmentsForSubscriptions to be used + * by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientCon") public interface ConfigurationAssignmentsForSubscriptionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("configurationAssignmentName") String configurationAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("configurationAssignmentName") String configurationAssignmentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @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); } /** - * Get configuration assignment - * - * Get configuration assignment for resource.. + * Get configuration assignment for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response} on successful completion of + * @return configuration assignment for resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -132,55 +200,19 @@ private Mono> getWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - configurationAssignmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get configuration assignment + * Get configuration assignment for resource. * - * Get configuration assignment for resource.. - * - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String configurationAssignmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), configurationAssignmentName, - this.client.getApiVersion(), accept, context); - } - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param configurationAssignmentName Configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. on successful completion of {@link Mono}. + * @return configuration assignment for resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String configurationAssignmentName) { @@ -188,28 +220,41 @@ private Mono getAsync(String configurationAssignme } /** - * Get configuration assignment + * Get configuration assignment for resource. * - * Get configuration assignment for resource.. - * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. + * @return configuration assignment for resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String configurationAssignmentName, Context context) { - return getWithResponseAsync(configurationAssignmentName, context).block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + configurationAssignmentName, accept, context); } /** - * Get configuration assignment - * - * Get configuration assignment for resource.. + * Get configuration assignment for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -221,11 +266,9 @@ public ConfigurationAssignmentInner get(String configurationAssignmentName) { } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -253,59 +296,19 @@ private Mono> createOrUpdateWithResponseA } else { configurationAssignment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, contentType, accept, + configurationAssignment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); - } else { - configurationAssignment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context); - } - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -320,11 +323,9 @@ private Mono createOrUpdateAsync(String configurat } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -335,15 +336,38 @@ private Mono createOrUpdateAsync(String configurat @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - return createOrUpdateWithResponseAsync(configurationAssignmentName, configurationAssignment, context).block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + if (configurationAssignment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + } else { + configurationAssignment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, contentType, accept, configurationAssignment, + context); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -358,11 +382,9 @@ public ConfigurationAssignmentInner createOrUpdate(String configurationAssignmen } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -390,59 +412,19 @@ private Mono> updateWithResponseAsync(Str } else { configurationAssignment.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, contentType, accept, + configurationAssignment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } - if (configurationAssignment == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); - } else { - configurationAssignment.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), configurationAssignmentName, - this.client.getApiVersion(), configurationAssignment, accept, context); - } - - /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -457,11 +439,9 @@ private Mono updateAsync(String configurationAssig } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -472,15 +452,38 @@ private Mono updateAsync(String configurationAssig @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context) { - return updateWithResponseAsync(configurationAssignmentName, configurationAssignment, context).block(); + 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + if (configurationAssignment == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null.")); + } else { + configurationAssignment.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, contentType, accept, configurationAssignment, + context); } /** - * Create configuration assignment - * * Register configuration for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -494,11 +497,9 @@ public ConfigurationAssignmentInner update(String configurationAssignmentName, } /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -520,26 +521,82 @@ private Mono> deleteWithResponseAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - configurationAssignmentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Unregister configuration for resource + * Unregister configuration for resource. * + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String configurationAssignmentName) { + return deleteWithResponseAsync(configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** * Unregister configuration for resource. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}. + * @return configuration Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String configurationAssignmentName, + public Response deleteWithResponse(String configurationAssignmentName, 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 (configurationAssignmentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter configurationAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), configurationAssignmentName, accept, context); + } + + /** + * Unregister configuration for resource. + * + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationAssignmentInner delete(String configurationAssignmentName) { + return deleteWithResponse(configurationAssignmentName, Context.NONE).getValue(); + } + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -548,63 +605,188 @@ private Mono> deleteWithResponseAsync(Str return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (configurationAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), configurationAssignmentName, - this.client.getApiVersion(), accept, context); + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Unregister configuration for resource + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. * - * Unregister configuration for resource. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment on successful completion of {@link Mono}. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String configurationAssignmentName) { - return deleteWithResponseAsync(configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + 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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Unregister configuration for resource + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. * - * Unregister configuration for resource. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. * - * @param configurationAssignmentName Unique configuration assignment name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String configurationAssignmentName, - Context context) { - return deleteWithResponseAsync(configurationAssignmentName, context).block(); + 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())); } /** - * Unregister configuration for resource + * Get the next page of items. * - * Unregister configuration for resource. + * @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 response for ConfigurationAssignments list 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 configurationAssignmentName Unique configuration assignment name. + * @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 configuration Assignment. + * @return response for ConfigurationAssignments list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationAssignmentInner delete(String configurationAssignmentName) { - return deleteWithResponse(configurationAssignmentName, Context.NONE).getValue(); + 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(ConfigurationAssignmentsForSubscriptionsClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsImpl.java index 7b551ac464c9..3d00e24da908 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsForSubscriptionsImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.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; @@ -66,6 +67,16 @@ public ConfigurationAssignment delete(String configurationAssignmentName) { } } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); + } + public ConfigurationAssignment getById(String id) { String configurationAssignmentName = ResourceManagerUtils.getValueFromIdByName(id, "configurationAssignments"); if (configurationAssignmentName == null) { diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsImpl.java index a7dd78d602b4..4b96320601ab 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -108,80 +108,6 @@ public ConfigurationAssignment deleteParent(String resourceGroupName, String pro } } - public Response getWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, - context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConfigurationAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConfigurationAssignment get(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName) { - ConfigurationAssignmentInner inner = this.serviceClient() - .get(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName); - if (inner != null) { - return new ConfigurationAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, configurationAssignment, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConfigurationAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConfigurationAssignment createOrUpdate(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) { - ConfigurationAssignmentInner inner = this.serviceClient() - .createOrUpdate(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, - configurationAssignment); - if (inner != null) { - return new ConfigurationAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context) { - Response inner = this.serviceClient() - .deleteWithResponse(resourceGroupName, providerName, resourceType, resourceName, - configurationAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConfigurationAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConfigurationAssignment delete(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName) { - ConfigurationAssignmentInner inner = this.serviceClient() - .delete(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName); - if (inner != null) { - return new ConfigurationAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - public PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) { PagedIterable inner = this.serviceClient() @@ -199,20 +125,6 @@ public PagedIterable listParent(String resourceGroupNam return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); } - public PagedIterable list(String resourceGroupName, String providerName, - String resourceType, String resourceName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, providerName, resourceType, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, providerName, resourceType, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); - } - private ConfigurationAssignmentsClient serviceClient() { return this.innerClient; } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsWithinSubscriptionsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsWithinSubscriptionsClientImpl.java deleted file mode 100644 index 7ca7915d00f7..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsWithinSubscriptionsClientImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.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.resourcemanager.maintenance.fluent.ConfigurationAssignmentsWithinSubscriptionsClient; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ListConfigurationAssignmentsResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * ConfigurationAssignmentsWithinSubscriptionsClient. - */ -public final class ConfigurationAssignmentsWithinSubscriptionsClientImpl - implements ConfigurationAssignmentsWithinSubscriptionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ConfigurationAssignmentsWithinSubscriptionsService service; - - /** - * The service client containing this operation class. - */ - private final MaintenanceManagementClientImpl client; - - /** - * Initializes an instance of ConfigurationAssignmentsWithinSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ConfigurationAssignmentsWithinSubscriptionsClientImpl(MaintenanceManagementClientImpl client) { - this.service = RestProxy.create(ConfigurationAssignmentsWithinSubscriptionsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * MaintenanceManagementClientConfigurationAssignmentsWithinSubscriptions to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") - public interface ConfigurationAssignmentsWithinSubscriptionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get configuration assignment within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get configuration assignment within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get configuration assignment within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get configuration assignment within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get configuration assignment within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get configuration assignment within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsWithinSubscriptionsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsWithinSubscriptionsImpl.java deleted file mode 100644 index e81c23eceabe..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ConfigurationAssignmentsWithinSubscriptionsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentsWithinSubscriptionsClient; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentsWithinSubscriptions; - -public final class ConfigurationAssignmentsWithinSubscriptionsImpl - implements ConfigurationAssignmentsWithinSubscriptions { - private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAssignmentsWithinSubscriptionsImpl.class); - - private final ConfigurationAssignmentsWithinSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; - - public ConfigurationAssignmentsWithinSubscriptionsImpl( - ConfigurationAssignmentsWithinSubscriptionsClient innerClient, - com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationAssignmentImpl(inner1, this.manager())); - } - - private ConfigurationAssignmentsWithinSubscriptionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceManagementClientBuilder.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceClientBuilder.java similarity index 65% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceManagementClientBuilder.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceClientBuilder.java index 11db9d00f38b..afcf43c040cb 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceManagementClientBuilder.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the MaintenanceManagementClientImpl type. + * A builder for creating a new instance of the MaintenanceClientImpl type. */ -@ServiceClientBuilder(serviceClients = { MaintenanceManagementClientImpl.class }) -public final class MaintenanceManagementClientBuilder { +@ServiceClientBuilder(serviceClients = { MaintenanceClientImpl.class }) +public final class MaintenanceClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the MaintenanceManagementClientBuilder. + * @param endpoint the endpoint value. + * @return the MaintenanceClientBuilder. */ - public MaintenanceManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public MaintenanceClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the MaintenanceManagementClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the MaintenanceClientBuilder. */ - public MaintenanceManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public MaintenanceClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public MaintenanceManagementClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the MaintenanceManagementClientBuilder. + * @return the MaintenanceClientBuilder. */ - public MaintenanceManagementClientBuilder environment(AzureEnvironment environment) { + public MaintenanceClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public MaintenanceManagementClientBuilder environment(AzureEnvironment environme * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the MaintenanceManagementClientBuilder. + * @return the MaintenanceClientBuilder. */ - public MaintenanceManagementClientBuilder pipeline(HttpPipeline pipeline) { + public MaintenanceClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public MaintenanceManagementClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the MaintenanceManagementClientBuilder. + * @return the MaintenanceClientBuilder. */ - public MaintenanceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public MaintenanceClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public MaintenanceManagementClientBuilder defaultPollInterval(Duration defaultPo * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the MaintenanceManagementClientBuilder. + * @return the MaintenanceClientBuilder. */ - public MaintenanceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public MaintenanceClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of MaintenanceManagementClientImpl with the provided parameters. + * Builds an instance of MaintenanceClientImpl with the provided parameters. * - * @return an instance of MaintenanceManagementClientImpl. + * @return an instance of MaintenanceClientImpl. */ - public MaintenanceManagementClientImpl buildClient() { + public MaintenanceClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public MaintenanceManagementClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - MaintenanceManagementClientImpl client = new MaintenanceManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + MaintenanceClientImpl client = new MaintenanceClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceManagementClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceClientImpl.java similarity index 65% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceManagementClientImpl.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceClientImpl.java index 30981072a170..0e633872c685 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceManagementClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -15,27 +15,32 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.maintenance.fluent.ApplyUpdateForResourceGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.ApplyUpdateForResourceGroupOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.ApplyUpdateOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.ApplyUpdatesClient; +import com.azure.resourcemanager.maintenance.fluent.ApplyUpdatesOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentForResourceGroupOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentsClient; import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentsForResourceGroupsClient; import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentsForSubscriptionsClient; -import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentsWithinSubscriptionsClient; +import com.azure.resourcemanager.maintenance.fluent.MaintenanceClient; +import com.azure.resourcemanager.maintenance.fluent.MaintenanceConfigurationOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.MaintenanceConfigurationsClient; -import com.azure.resourcemanager.maintenance.fluent.MaintenanceConfigurationsForResourceGroupsClient; -import com.azure.resourcemanager.maintenance.fluent.MaintenanceManagementClient; import com.azure.resourcemanager.maintenance.fluent.OperationsClient; -import com.azure.resourcemanager.maintenance.fluent.PublicMaintenanceConfigurationsClient; -import com.azure.resourcemanager.maintenance.fluent.ScheduledEventsClient; -import com.azure.resourcemanager.maintenance.fluent.UpdatesClient; +import com.azure.resourcemanager.maintenance.fluent.ScheduledEventOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.UpdatesOperationGroupsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -46,31 +51,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the MaintenanceManagementClientImpl type. + * Initializes a new instance of the MaintenanceClientImpl type. */ -@ServiceClient(builder = MaintenanceManagementClientBuilder.class) -public final class MaintenanceManagementClientImpl implements MaintenanceManagementClient { +@ServiceClient(builder = MaintenanceClientBuilder.class) +public final class MaintenanceClientImpl implements MaintenanceClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -79,12 +70,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -92,6 +83,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -135,31 +140,45 @@ public Duration getDefaultPollInterval() { } /** - * The ScheduledEventsClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final ScheduledEventsClient scheduledEvents; + private final OperationsClient operations; /** - * Gets the ScheduledEventsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ScheduledEventsClient object. + * @return the OperationsClient object. */ - public ScheduledEventsClient getScheduledEvents() { - return this.scheduledEvents; + public OperationsClient getOperations() { + return this.operations; } /** - * The PublicMaintenanceConfigurationsClient object to access its operations. + * The MaintenanceConfigurationsClient object to access its operations. */ - private final PublicMaintenanceConfigurationsClient publicMaintenanceConfigurations; + private final MaintenanceConfigurationsClient maintenanceConfigurations; /** - * Gets the PublicMaintenanceConfigurationsClient object to access its operations. + * Gets the MaintenanceConfigurationsClient object to access its operations. * - * @return the PublicMaintenanceConfigurationsClient object. + * @return the MaintenanceConfigurationsClient object. */ - public PublicMaintenanceConfigurationsClient getPublicMaintenanceConfigurations() { - return this.publicMaintenanceConfigurations; + public MaintenanceConfigurationsClient getMaintenanceConfigurations() { + return this.maintenanceConfigurations; + } + + /** + * The MaintenanceConfigurationOperationGroupsClient object to access its operations. + */ + private final MaintenanceConfigurationOperationGroupsClient maintenanceConfigurationOperationGroups; + + /** + * Gets the MaintenanceConfigurationOperationGroupsClient object to access its operations. + * + * @return the MaintenanceConfigurationOperationGroupsClient object. + */ + public MaintenanceConfigurationOperationGroupsClient getMaintenanceConfigurationOperationGroups() { + return this.maintenanceConfigurationOperationGroups; } /** @@ -176,6 +195,20 @@ public ApplyUpdatesClient getApplyUpdates() { return this.applyUpdates; } + /** + * The ApplyUpdateOperationGroupsClient object to access its operations. + */ + private final ApplyUpdateOperationGroupsClient applyUpdateOperationGroups; + + /** + * Gets the ApplyUpdateOperationGroupsClient object to access its operations. + * + * @return the ApplyUpdateOperationGroupsClient object. + */ + public ApplyUpdateOperationGroupsClient getApplyUpdateOperationGroups() { + return this.applyUpdateOperationGroups; + } + /** * The ConfigurationAssignmentsClient object to access its operations. */ @@ -191,149 +224,152 @@ public ConfigurationAssignmentsClient getConfigurationAssignments() { } /** - * The MaintenanceConfigurationsClient object to access its operations. + * The ConfigurationAssignmentOperationGroupsClient object to access its operations. */ - private final MaintenanceConfigurationsClient maintenanceConfigurations; + private final ConfigurationAssignmentOperationGroupsClient configurationAssignmentOperationGroups; /** - * Gets the MaintenanceConfigurationsClient object to access its operations. + * Gets the ConfigurationAssignmentOperationGroupsClient object to access its operations. * - * @return the MaintenanceConfigurationsClient object. + * @return the ConfigurationAssignmentOperationGroupsClient object. */ - public MaintenanceConfigurationsClient getMaintenanceConfigurations() { - return this.maintenanceConfigurations; + public ConfigurationAssignmentOperationGroupsClient getConfigurationAssignmentOperationGroups() { + return this.configurationAssignmentOperationGroups; } /** - * The MaintenanceConfigurationsForResourceGroupsClient object to access its operations. + * The ConfigurationAssignmentsForSubscriptionsClient object to access its operations. */ - private final MaintenanceConfigurationsForResourceGroupsClient maintenanceConfigurationsForResourceGroups; + private final ConfigurationAssignmentsForSubscriptionsClient configurationAssignmentsForSubscriptions; /** - * Gets the MaintenanceConfigurationsForResourceGroupsClient object to access its operations. + * Gets the ConfigurationAssignmentsForSubscriptionsClient object to access its operations. * - * @return the MaintenanceConfigurationsForResourceGroupsClient object. + * @return the ConfigurationAssignmentsForSubscriptionsClient object. */ - public MaintenanceConfigurationsForResourceGroupsClient getMaintenanceConfigurationsForResourceGroups() { - return this.maintenanceConfigurationsForResourceGroups; + public ConfigurationAssignmentsForSubscriptionsClient getConfigurationAssignmentsForSubscriptions() { + return this.configurationAssignmentsForSubscriptions; } /** - * The ApplyUpdateForResourceGroupsClient object to access its operations. + * The ConfigurationAssignmentsForResourceGroupsClient object to access its operations. */ - private final ApplyUpdateForResourceGroupsClient applyUpdateForResourceGroups; + private final ConfigurationAssignmentsForResourceGroupsClient configurationAssignmentsForResourceGroups; /** - * Gets the ApplyUpdateForResourceGroupsClient object to access its operations. + * Gets the ConfigurationAssignmentsForResourceGroupsClient object to access its operations. * - * @return the ApplyUpdateForResourceGroupsClient object. + * @return the ConfigurationAssignmentsForResourceGroupsClient object. */ - public ApplyUpdateForResourceGroupsClient getApplyUpdateForResourceGroups() { - return this.applyUpdateForResourceGroups; + public ConfigurationAssignmentsForResourceGroupsClient getConfigurationAssignmentsForResourceGroups() { + return this.configurationAssignmentsForResourceGroups; } /** - * The ConfigurationAssignmentsWithinSubscriptionsClient object to access its operations. + * The ScheduledEventOperationGroupsClient object to access its operations. */ - private final ConfigurationAssignmentsWithinSubscriptionsClient configurationAssignmentsWithinSubscriptions; + private final ScheduledEventOperationGroupsClient scheduledEventOperationGroups; /** - * Gets the ConfigurationAssignmentsWithinSubscriptionsClient object to access its operations. + * Gets the ScheduledEventOperationGroupsClient object to access its operations. * - * @return the ConfigurationAssignmentsWithinSubscriptionsClient object. + * @return the ScheduledEventOperationGroupsClient object. */ - public ConfigurationAssignmentsWithinSubscriptionsClient getConfigurationAssignmentsWithinSubscriptions() { - return this.configurationAssignmentsWithinSubscriptions; + public ScheduledEventOperationGroupsClient getScheduledEventOperationGroups() { + return this.scheduledEventOperationGroups; } /** - * The ConfigurationAssignmentsForSubscriptionsClient object to access its operations. + * The ApplyUpdatesOperationGroupsClient object to access its operations. */ - private final ConfigurationAssignmentsForSubscriptionsClient configurationAssignmentsForSubscriptions; + private final ApplyUpdatesOperationGroupsClient applyUpdatesOperationGroups; /** - * Gets the ConfigurationAssignmentsForSubscriptionsClient object to access its operations. + * Gets the ApplyUpdatesOperationGroupsClient object to access its operations. * - * @return the ConfigurationAssignmentsForSubscriptionsClient object. + * @return the ApplyUpdatesOperationGroupsClient object. */ - public ConfigurationAssignmentsForSubscriptionsClient getConfigurationAssignmentsForSubscriptions() { - return this.configurationAssignmentsForSubscriptions; + public ApplyUpdatesOperationGroupsClient getApplyUpdatesOperationGroups() { + return this.applyUpdatesOperationGroups; } /** - * The ConfigurationAssignmentsForResourceGroupsClient object to access its operations. + * The ApplyUpdateForResourceGroupOperationGroupsClient object to access its operations. */ - private final ConfigurationAssignmentsForResourceGroupsClient configurationAssignmentsForResourceGroups; + private final ApplyUpdateForResourceGroupOperationGroupsClient applyUpdateForResourceGroupOperationGroups; /** - * Gets the ConfigurationAssignmentsForResourceGroupsClient object to access its operations. + * Gets the ApplyUpdateForResourceGroupOperationGroupsClient object to access its operations. * - * @return the ConfigurationAssignmentsForResourceGroupsClient object. + * @return the ApplyUpdateForResourceGroupOperationGroupsClient object. */ - public ConfigurationAssignmentsForResourceGroupsClient getConfigurationAssignmentsForResourceGroups() { - return this.configurationAssignmentsForResourceGroups; + public ApplyUpdateForResourceGroupOperationGroupsClient getApplyUpdateForResourceGroupOperationGroups() { + return this.applyUpdateForResourceGroupOperationGroups; } /** - * The OperationsClient object to access its operations. + * The ConfigurationAssignmentForResourceGroupOperationGroupsClient object to access its operations. */ - private final OperationsClient operations; + private final ConfigurationAssignmentForResourceGroupOperationGroupsClient configurationAssignmentForResourceGroupOperationGroups; /** - * Gets the OperationsClient object to access its operations. + * Gets the ConfigurationAssignmentForResourceGroupOperationGroupsClient object to access its operations. * - * @return the OperationsClient object. + * @return the ConfigurationAssignmentForResourceGroupOperationGroupsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public ConfigurationAssignmentForResourceGroupOperationGroupsClient + getConfigurationAssignmentForResourceGroupOperationGroups() { + return this.configurationAssignmentForResourceGroupOperationGroups; } /** - * The UpdatesClient object to access its operations. + * The UpdatesOperationGroupsClient object to access its operations. */ - private final UpdatesClient updates; + private final UpdatesOperationGroupsClient updatesOperationGroups; /** - * Gets the UpdatesClient object to access its operations. + * Gets the UpdatesOperationGroupsClient object to access its operations. * - * @return the UpdatesClient object. + * @return the UpdatesOperationGroupsClient object. */ - public UpdatesClient getUpdates() { - return this.updates; + public UpdatesOperationGroupsClient getUpdatesOperationGroups() { + return this.updatesOperationGroups; } /** - * Initializes an instance of MaintenanceManagementClient client. + * Initializes an instance of MaintenanceClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ - MaintenanceManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + MaintenanceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, + AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2023-10-01-preview"; - this.scheduledEvents = new ScheduledEventsClientImpl(this); - this.publicMaintenanceConfigurations = new PublicMaintenanceConfigurationsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.maintenanceConfigurations = new MaintenanceConfigurationsClientImpl(this); + this.maintenanceConfigurationOperationGroups = new MaintenanceConfigurationOperationGroupsClientImpl(this); this.applyUpdates = new ApplyUpdatesClientImpl(this); + this.applyUpdateOperationGroups = new ApplyUpdateOperationGroupsClientImpl(this); this.configurationAssignments = new ConfigurationAssignmentsClientImpl(this); - this.maintenanceConfigurations = new MaintenanceConfigurationsClientImpl(this); - this.maintenanceConfigurationsForResourceGroups - = new MaintenanceConfigurationsForResourceGroupsClientImpl(this); - this.applyUpdateForResourceGroups = new ApplyUpdateForResourceGroupsClientImpl(this); - this.configurationAssignmentsWithinSubscriptions - = new ConfigurationAssignmentsWithinSubscriptionsClientImpl(this); + this.configurationAssignmentOperationGroups = new ConfigurationAssignmentOperationGroupsClientImpl(this); this.configurationAssignmentsForSubscriptions = new ConfigurationAssignmentsForSubscriptionsClientImpl(this); this.configurationAssignmentsForResourceGroups = new ConfigurationAssignmentsForResourceGroupsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.updates = new UpdatesClientImpl(this); + this.scheduledEventOperationGroups = new ScheduledEventOperationGroupsClientImpl(this); + this.applyUpdatesOperationGroups = new ApplyUpdatesOperationGroupsClientImpl(this); + this.applyUpdateForResourceGroupOperationGroups + = new ApplyUpdateForResourceGroupOperationGroupsClientImpl(this); + this.configurationAssignmentForResourceGroupOperationGroups + = new ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl(this); + this.updatesOperationGroups = new UpdatesOperationGroupsClientImpl(this); } /** @@ -373,6 +409,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -462,5 +515,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(MaintenanceManagementClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(MaintenanceClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationImpl.java index 69fa8ee959a8..82d22c7dc374 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -126,7 +126,7 @@ public MaintenanceConfigurationImpl withExistingResourceGroup(String resourceGro public MaintenanceConfiguration create() { this.innerObject = serviceManager.serviceClient() - .getMaintenanceConfigurations() + .getMaintenanceConfigurationOperationGroups() .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -134,7 +134,7 @@ public MaintenanceConfiguration create() { public MaintenanceConfiguration create(Context context) { this.innerObject = serviceManager.serviceClient() - .getMaintenanceConfigurations() + .getMaintenanceConfigurationOperationGroups() .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) .getValue(); return this; @@ -152,7 +152,7 @@ public MaintenanceConfigurationImpl update() { public MaintenanceConfiguration apply() { this.innerObject = serviceManager.serviceClient() - .getMaintenanceConfigurations() + .getMaintenanceConfigurationOperationGroups() .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -160,7 +160,7 @@ public MaintenanceConfiguration apply() { public MaintenanceConfiguration apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getMaintenanceConfigurations() + .getMaintenanceConfigurationOperationGroups() .updateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) .getValue(); return this; @@ -170,13 +170,13 @@ public MaintenanceConfiguration apply(Context context) { com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "maintenanceConfigurations"); } public MaintenanceConfiguration refresh() { this.innerObject = serviceManager.serviceClient() - .getMaintenanceConfigurations() + .getMaintenanceConfigurationOperationGroups() .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) .getValue(); return this; @@ -184,7 +184,7 @@ public MaintenanceConfiguration refresh() { public MaintenanceConfiguration refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getMaintenanceConfigurations() + .getMaintenanceConfigurationOperationGroups() .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) .getValue(); return this; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationOperationGroupsClientImpl.java new file mode 100644 index 000000000000..0f93a6789e55 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationOperationGroupsClientImpl.java @@ -0,0 +1,1106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.maintenance.fluent.MaintenanceConfigurationOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.maintenance.implementation.models.ListMaintenanceConfigurationsResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * MaintenanceConfigurationOperationGroupsClient. + */ +public final class MaintenanceConfigurationOperationGroupsClientImpl + implements MaintenanceConfigurationOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final MaintenanceConfigurationOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of MaintenanceConfigurationOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MaintenanceConfigurationOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(MaintenanceConfigurationOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MaintenanceClientMaintenanceConfigurationOperationGroups to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientMai") + public interface MaintenanceConfigurationOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @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("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceConfigurationInner configuration, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @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("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceConfigurationInner configuration, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceConfigurationInner configuration, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MaintenanceConfigurationInner configuration, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/maintenanceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/maintenanceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> maintenanceConfigurationsListNext( + @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 maintenanceConfigurationsListNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String resourceName, 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 (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Create or Update configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, MaintenanceConfigurationInner configuration) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configuration == null) { + return Mono.error(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); + } else { + configuration.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, resourceName, contentType, accept, configuration, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, configuration) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String resourceName, MaintenanceConfigurationInner configuration, 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 (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configuration == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); + } else { + configuration.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, configuration, + context); + } + + /** + * Create or Update configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner createOrUpdate(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration) { + return createOrUpdateWithResponse(resourceGroupName, resourceName, configuration, Context.NONE).getValue(); + } + + /** + * Patch configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String resourceName, MaintenanceConfigurationInner configuration) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configuration == null) { + return Mono.error(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); + } else { + configuration.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, configuration, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration) { + return updateWithResponseAsync(resourceGroupName, resourceName, configuration) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration, 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 (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configuration == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); + } else { + configuration.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, configuration, + context); + } + + /** + * Patch configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param configuration The configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner update(String resourceGroupName, String resourceName, + MaintenanceConfigurationInner configuration) { + return updateWithResponse(resourceGroupName, resourceName, configuration, Context.NONE).getValue(); + } + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, + String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String resourceName, + 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 (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner delete(String resourceGroupName, String resourceName) { + return deleteWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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(), + this.client.getSubscriptionId(), resourceGroupName, 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 Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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(), + this.client.getSubscriptionId(), 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 Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> maintenanceConfigurationsListNextSinglePageAsync(nextLink)); + } + + /** + * Get Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Configuration records within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), + nextLink -> maintenanceConfigurationsListNextSinglePage(nextLink)); + } + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> maintenanceConfigurationsListNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for MaintenanceConfigurations list 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 response for MaintenanceConfigurations list 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 response for MaintenanceConfigurations list 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); + } + + /** + * 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 response for MaintenanceConfigurations list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + maintenanceConfigurationsListNextSinglePageAsync(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.maintenanceConfigurationsListNext(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 response for MaintenanceConfigurations list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse maintenanceConfigurationsListNextSinglePage(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.maintenanceConfigurationsListNextSync(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 response for MaintenanceConfigurations list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse maintenanceConfigurationsListNextSinglePage(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.maintenanceConfigurationsListNextSync(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(MaintenanceConfigurationOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationOperationGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationOperationGroupsImpl.java new file mode 100644 index 000000000000..616e906cf128 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationOperationGroupsImpl.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.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.maintenance.fluent.MaintenanceConfigurationOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfigurationOperationGroups; + +public final class MaintenanceConfigurationOperationGroupsImpl implements MaintenanceConfigurationOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(MaintenanceConfigurationOperationGroupsImpl.class); + + private final MaintenanceConfigurationOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; + + public MaintenanceConfigurationOperationGroupsImpl(MaintenanceConfigurationOperationGroupsClient innerClient, + com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String resourceName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MaintenanceConfiguration getByResourceGroup(String resourceGroupName, String resourceName) { + MaintenanceConfigurationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new MaintenanceConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, + String resourceName, Context context) { + Response inner + = this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MaintenanceConfiguration deleteByResourceGroup(String resourceGroupName, String resourceName) { + MaintenanceConfigurationInner inner = this.serviceClient().delete(resourceGroupName, resourceName); + if (inner != null) { + return new MaintenanceConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public MaintenanceConfiguration 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public MaintenanceConfiguration 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + private MaintenanceConfigurationOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { + return this.serviceManager; + } + + public MaintenanceConfigurationImpl define(String name) { + return new MaintenanceConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsClientImpl.java index 70e3e66e47fd..4115271fd9c9 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsClientImpl.java @@ -1,20 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.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.Patch; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -29,9 +25,10 @@ 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.maintenance.fluent.MaintenanceConfigurationsClient; import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.ListMaintenanceConfigurationsResult; +import com.azure.resourcemanager.maintenance.implementation.models.ListMaintenanceConfigurationsResult; import reactor.core.publisher.Mono; /** @@ -46,88 +43,87 @@ public final class MaintenanceConfigurationsClientImpl implements MaintenanceCon /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** * Initializes an instance of MaintenanceConfigurationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - MaintenanceConfigurationsClientImpl(MaintenanceManagementClientImpl client) { + MaintenanceConfigurationsClientImpl(MaintenanceClientImpl client) { this.service = RestProxy.create(MaintenanceConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientMaintenanceConfigurations to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for MaintenanceClientMaintenanceConfigurations to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientMai") public interface MaintenanceConfigurationsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MaintenanceConfigurationInner configuration, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MaintenanceConfigurationInner configuration, + 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("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/maintenanceConfigurations") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response} on successful completion of {@link Mono}. + * @return public Maintenance Configuration record along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName) { + private Mono> getWithResponseAsync(String resourceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -136,255 +132,85 @@ private Mono> getByResourceGroupWithResp 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 (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, this.client.getApiVersion(), accept, context); - } - - /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record on successful completion of {@link Mono}. + * @return public Maintenance Configuration record on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String resourceName) { + return getWithResponseAsync(resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String resourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Get Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record. + * @return public Maintenance Configuration record along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceConfigurationInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } - - /** - * Create or Update configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, MaintenanceConfigurationInner configuration) { + public Response getWithResponse(String resourceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configuration == null) { - return Mono.error(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); - } else { - configuration.validate(); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), configuration, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceName, accept, context); } /** - * Create or Update configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @param context The context to associate with this operation. + * @param resourceName The name of the MaintenanceConfiguration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response} on successful completion of - * {@link Mono}. + * @return public Maintenance Configuration record. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, MaintenanceConfigurationInner configuration, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configuration == null) { - return Mono.error(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); - } else { - configuration.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, this.client.getApiVersion(), configuration, accept, context); + public MaintenanceConfigurationInner get(String resourceName) { + return getWithResponse(resourceName, Context.NONE).getValue(); } /** - * Create or Update configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, configuration) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or Update configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String resourceName, MaintenanceConfigurationInner configuration, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, configuration, context).block(); - } - - /** - * Create or Update configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceConfigurationInner createOrUpdate(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration) { - return createOrUpdateWithResponse(resourceGroupName, resourceName, configuration, Context.NONE).getValue(); - } - - /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response} on successful completion of + * @return public Maintenance Configuration records along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, - String resourceName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -393,346 +219,187 @@ private Mono> deleteWithResponseAsync(St 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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())); } /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, this.client.getApiVersion(), accept, context); - } - - /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName) { - return deleteWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, context).block(); - } - - /** - * Delete Configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type. + * @return public Maintenance Configuration records as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceConfigurationInner delete(String resourceGroupName, String resourceName) { - return deleteWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Patch configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response} on successful completion of - * {@link Mono}. + * @return public Maintenance Configuration records along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String resourceName, MaintenanceConfigurationInner configuration) { + private PagedResponse listSinglePage() { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configuration == null) { - return Mono.error(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); - } else { - configuration.validate(); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), configuration, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Patch configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response} on successful completion of - * {@link Mono}. + * @return public Maintenance Configuration records along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String resourceName, MaintenanceConfigurationInner configuration, Context context) { + private PagedResponse listSinglePage(Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (configuration == null) { - return Mono.error(new IllegalArgumentException("Parameter configuration is required and cannot be null.")); - } else { - configuration.validate(); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, this.client.getApiVersion(), configuration, accept, context); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Patch configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type on successful completion of {@link Mono}. + * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration) { - return updateWithResponseAsync(resourceGroupName, resourceName, configuration) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Patch configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. + * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration, Context context) { - return updateWithResponseAsync(resourceGroupName, resourceName, configuration, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Patch configuration record. + * Get the next page of items. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param configuration The configuration. + * @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 maintenance configuration record type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceConfigurationInner update(String resourceGroupName, String resourceName, - MaintenanceConfigurationInner configuration) { - return updateWithResponse(resourceGroupName, resourceName, configuration, Context.NONE).getValue(); - } - - /** - * Get Configuration records within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription along with {@link PagedResponse} on successful completion of + * @return response for MaintenanceConfigurations list along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + 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.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) + 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(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get Configuration records within a subscription. + * Get the next page of items. * - * @param context The context to associate with this operation. + * @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 configuration records within a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response for MaintenanceConfigurations list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + 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 Configuration records within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get Configuration records within a subscription. + * 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 configuration records within a subscription as paginated response with {@link PagedFlux}. + * @return response for MaintenanceConfigurations list along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get Configuration records within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @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); } - /** - * Get Configuration records within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } + private static final ClientLogger LOGGER = new ClientLogger(MaintenanceConfigurationsClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsForResourceGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsForResourceGroupsClientImpl.java deleted file mode 100644 index 030116c06651..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsForResourceGroupsClientImpl.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.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.resourcemanager.maintenance.fluent.MaintenanceConfigurationsForResourceGroupsClient; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.ListMaintenanceConfigurationsResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * MaintenanceConfigurationsForResourceGroupsClient. - */ -public final class MaintenanceConfigurationsForResourceGroupsClientImpl - implements MaintenanceConfigurationsForResourceGroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final MaintenanceConfigurationsForResourceGroupsService service; - - /** - * The service client containing this operation class. - */ - private final MaintenanceManagementClientImpl client; - - /** - * Initializes an instance of MaintenanceConfigurationsForResourceGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MaintenanceConfigurationsForResourceGroupsClientImpl(MaintenanceManagementClientImpl client) { - this.service = RestProxy.create(MaintenanceConfigurationsForResourceGroupsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MaintenanceManagementClientMaintenanceConfigurationsForResourceGroups - * to be used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") - public interface MaintenanceConfigurationsForResourceGroupsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get Configuration records within a subscription and resource group. - * - * @param resourceGroupName Resource Group Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription and resource group as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsForResourceGroupsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsForResourceGroupsImpl.java deleted file mode 100644 index 67fbcbfa86b0..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsForResourceGroupsImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.maintenance.fluent.MaintenanceConfigurationsForResourceGroupsClient; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfigurationsForResourceGroups; - -public final class MaintenanceConfigurationsForResourceGroupsImpl - implements MaintenanceConfigurationsForResourceGroups { - private static final ClientLogger LOGGER = new ClientLogger(MaintenanceConfigurationsForResourceGroupsImpl.class); - - private final MaintenanceConfigurationsForResourceGroupsClient innerClient; - - private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; - - public MaintenanceConfigurationsForResourceGroupsImpl(MaintenanceConfigurationsForResourceGroupsClient innerClient, - com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); - } - - private MaintenanceConfigurationsForResourceGroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsImpl.java index aa725e271566..38c1beaa781a 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/MaintenanceConfigurationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -27,10 +27,8 @@ public MaintenanceConfigurationsImpl(MaintenanceConfigurationsClient innerClient this.serviceManager = serviceManager; } - public Response getByResourceGroupWithResponse(String resourceGroupName, - String resourceName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + public Response getWithResponse(String resourceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); @@ -39,29 +37,8 @@ public Response getByResourceGroupWithResponse(String } } - public MaintenanceConfiguration getByResourceGroup(String resourceGroupName, String resourceName) { - MaintenanceConfigurationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); - if (inner != null) { - return new MaintenanceConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, - String resourceName, Context context) { - Response inner - = this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MaintenanceConfiguration deleteByResourceGroup(String resourceGroupName, String resourceName) { - MaintenanceConfigurationInner inner = this.serviceClient().delete(resourceGroupName, resourceName); + public MaintenanceConfiguration get(String resourceName) { + MaintenanceConfigurationInner inner = this.serviceClient().get(resourceName); if (inner != null) { return new MaintenanceConfigurationImpl(inner, this.manager()); } else { @@ -79,62 +56,6 @@ public PagedIterable list(Context context) { return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); } - public MaintenanceConfiguration 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); - } - - public MaintenanceConfiguration 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } - - public Response 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "maintenanceConfigurations"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, resourceName, context); - } - private MaintenanceConfigurationsClient serviceClient() { return this.innerClient; } @@ -142,8 +63,4 @@ private MaintenanceConfigurationsClient serviceClient() { private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { return this.serviceManager; } - - public MaintenanceConfigurationImpl define(String name) { - return new MaintenanceConfigurationImpl(name, this.manager()); - } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationImpl.java index ec3e36771d1e..fabde61cf2a6 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationImpl.java @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; import com.azure.resourcemanager.maintenance.fluent.models.OperationInner; +import com.azure.resourcemanager.maintenance.models.ActionType; import com.azure.resourcemanager.maintenance.models.Operation; -import com.azure.resourcemanager.maintenance.models.OperationInfo; +import com.azure.resourcemanager.maintenance.models.OperationDisplay; +import com.azure.resourcemanager.maintenance.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -22,20 +24,20 @@ public String name() { return this.innerModel().name(); } - public OperationInfo display() { - return this.innerModel().display(); + public Boolean isDataAction() { + return this.innerModel().isDataAction(); } - public String origin() { - return this.innerModel().origin(); + public OperationDisplay display() { + return this.innerModel().display(); } - public Object properties() { - return this.innerModel().properties(); + public Origin origin() { + return this.innerModel().origin(); } - public Boolean isDataAction() { - return this.innerModel().isDataAction(); + public ActionType actionType() { + return this.innerModel().actionType(); } public OperationInner innerModel() { diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsClientImpl.java index fab64b17ca06..016d6d051945 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -10,6 +10,7 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -24,9 +25,10 @@ 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.maintenance.fluent.OperationsClient; import com.azure.resourcemanager.maintenance.fluent.models.OperationInner; -import com.azure.resourcemanager.maintenance.models.OperationsListResult; +import com.azure.resourcemanager.maintenance.implementation.models.OperationsListResult; import reactor.core.publisher.Mono; /** @@ -41,38 +43,59 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(MaintenanceManagementClientImpl client) { + OperationsClientImpl(MaintenanceClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for MaintenanceClientOperations to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientOpe") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Maintenance/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Maintenance/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -90,92 +113,187 @@ private Mono> listSinglePageAsync() { .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List available operations + * + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the List Operations operation along with {@link PagedResponse}. + */ + @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); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List available operations + * + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the List Operations operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of the List Operations operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private PagedResponse listSinglePage(Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the List Operations operation as paginated response with {@link PagedFlux}. + * @return result of the List Operations operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the List Operations operation as paginated response with {@link PagedFlux}. + * @return result of the List Operations operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * 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 result of the List Operations operation as paginated response with {@link PagedIterable}. + * @return result of the List Operations operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @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())); + } + + /** + * List available operations + * + * 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 result of the List Operations 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); } /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * 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 result of the List Operations operation as paginated response with {@link PagedIterable}. + * @return result of the List Operations operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @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/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsImpl.java index 51142750dc0d..9a5901274bee 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/PublicMaintenanceConfigurationsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/PublicMaintenanceConfigurationsClientImpl.java deleted file mode 100644 index 41d813c727d2..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/PublicMaintenanceConfigurationsClientImpl.java +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.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.resourcemanager.maintenance.fluent.PublicMaintenanceConfigurationsClient; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.ListMaintenanceConfigurationsResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PublicMaintenanceConfigurationsClient. - */ -public final class PublicMaintenanceConfigurationsClientImpl implements PublicMaintenanceConfigurationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PublicMaintenanceConfigurationsService service; - - /** - * The service client containing this operation class. - */ - private final MaintenanceManagementClientImpl client; - - /** - * Initializes an instance of PublicMaintenanceConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PublicMaintenanceConfigurationsClientImpl(MaintenanceManagementClientImpl client) { - this.service = RestProxy.create(PublicMaintenanceConfigurationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MaintenanceManagementClientPublicMaintenanceConfigurations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") - public interface PublicMaintenanceConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get Public Maintenance Configuration records. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Public Maintenance Configuration records. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get Public Maintenance Configuration records. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); - } - - /** - * Get Public Maintenance Configuration records. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * Get Public Maintenance Configuration records. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get Public Maintenance Configuration records. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName) { - 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 (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceName, - this.client.getApiVersion(), accept, context); - } - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceName) { - return getWithResponseAsync(resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceName, Context context) { - return getWithResponseAsync(resourceName, context).block(); - } - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MaintenanceConfigurationInner get(String resourceName) { - return getWithResponse(resourceName, Context.NONE).getValue(); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/PublicMaintenanceConfigurationsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/PublicMaintenanceConfigurationsImpl.java deleted file mode 100644 index da9d005980ed..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/PublicMaintenanceConfigurationsImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.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.maintenance.fluent.PublicMaintenanceConfigurationsClient; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.PublicMaintenanceConfigurations; - -public final class PublicMaintenanceConfigurationsImpl implements PublicMaintenanceConfigurations { - private static final ClientLogger LOGGER = new ClientLogger(PublicMaintenanceConfigurationsImpl.class); - - private final PublicMaintenanceConfigurationsClient innerClient; - - private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; - - public PublicMaintenanceConfigurationsImpl(PublicMaintenanceConfigurationsClient innerClient, - com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MaintenanceConfiguration get(String resourceName) { - MaintenanceConfigurationInner inner = this.serviceClient().get(resourceName); - if (inner != null) { - return new MaintenanceConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - private PublicMaintenanceConfigurationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.maintenance.MaintenanceManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ResourceManagerUtils.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ResourceManagerUtils.java index 039ad85d8cda..75985735dc6b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ResourceManagerUtils.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventApproveResponseImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventApproveResponseImpl.java index c2534d4a4cc4..0adb4a495987 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventApproveResponseImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventApproveResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventOperationGroupsClientImpl.java similarity index 69% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventsClientImpl.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventOperationGroupsClientImpl.java index dd5c95c4f632..12846e91477b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventsClientImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventOperationGroupsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -21,51 +21,62 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.maintenance.fluent.ScheduledEventsClient; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.maintenance.fluent.ScheduledEventOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.models.ScheduledEventApproveResponseInner; import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in ScheduledEventsClient. + * An instance of this class provides access to all the operations defined in ScheduledEventOperationGroupsClient. */ -public final class ScheduledEventsClientImpl implements ScheduledEventsClient { +public final class ScheduledEventOperationGroupsClientImpl implements ScheduledEventOperationGroupsClient { /** * The proxy service used to perform REST calls. */ - private final ScheduledEventsService service; + private final ScheduledEventOperationGroupsService service; /** * The service client containing this operation class. */ - private final MaintenanceManagementClientImpl client; + private final MaintenanceClientImpl client; /** - * Initializes an instance of ScheduledEventsClientImpl. + * Initializes an instance of ScheduledEventOperationGroupsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ScheduledEventsClientImpl(MaintenanceManagementClientImpl client) { - this.service - = RestProxy.create(ScheduledEventsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + ScheduledEventOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(ScheduledEventOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MaintenanceManagementClientScheduledEvents to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for MaintenanceClientScheduledEventOperationGroups to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") - public interface ScheduledEventsService { + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientSch") + public interface ScheduledEventOperationGroupsService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/scheduledevents/{scheduledEventId}/acknowledge") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> acknowledge(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> acknowledge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, @PathParam("scheduledEventId") String scheduledEventId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/scheduledevents/{scheduledEventId}/acknowledge") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response acknowledgeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @PathParam("scheduledEventId") String scheduledEventId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -109,58 +120,12 @@ private Mono> acknowledgeWithRespon } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.acknowledge(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceType, resourceName, scheduledEventId, this.client.getApiVersion(), accept, - context)) + .withContext(context -> service.acknowledge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceType, resourceName, scheduledEventId, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Post Scheduled Event Acknowledgement. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceType Resource type. - * @param resourceName Resource Name. - * @param scheduledEventId Scheduled Event Id. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of scheduled event acknowledge along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> acknowledgeWithResponseAsync(String resourceGroupName, - String resourceType, String resourceName, String scheduledEventId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (scheduledEventId == null) { - return Mono - .error(new IllegalArgumentException("Parameter scheduledEventId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.acknowledge(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceType, resourceName, scheduledEventId, this.client.getApiVersion(), accept, context); - } - /** * Post Scheduled Event Acknowledgement. * @@ -198,8 +163,36 @@ private Mono acknowledgeAsync(String resourc @ServiceMethod(returns = ReturnType.SINGLE) public Response acknowledgeWithResponse(String resourceGroupName, String resourceType, String resourceName, String scheduledEventId, Context context) { - return acknowledgeWithResponseAsync(resourceGroupName, resourceType, resourceName, scheduledEventId, context) - .block(); + 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 (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (scheduledEventId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter scheduledEventId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.acknowledgeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceType, resourceName, scheduledEventId, accept, + context); } /** @@ -221,4 +214,6 @@ public ScheduledEventApproveResponseInner acknowledge(String resourceGroupName, return acknowledgeWithResponse(resourceGroupName, resourceType, resourceName, scheduledEventId, Context.NONE) .getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(ScheduledEventOperationGroupsClientImpl.class); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventsImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventOperationGroupsImpl.java similarity index 83% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventsImpl.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventOperationGroupsImpl.java index 135bc2954867..aa375c18dbd7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventsImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/ScheduledEventOperationGroupsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -8,19 +8,19 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.maintenance.fluent.ScheduledEventsClient; +import com.azure.resourcemanager.maintenance.fluent.ScheduledEventOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.models.ScheduledEventApproveResponseInner; import com.azure.resourcemanager.maintenance.models.ScheduledEventApproveResponse; -import com.azure.resourcemanager.maintenance.models.ScheduledEvents; +import com.azure.resourcemanager.maintenance.models.ScheduledEventOperationGroups; -public final class ScheduledEventsImpl implements ScheduledEvents { - private static final ClientLogger LOGGER = new ClientLogger(ScheduledEventsImpl.class); +public final class ScheduledEventOperationGroupsImpl implements ScheduledEventOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(ScheduledEventOperationGroupsImpl.class); - private final ScheduledEventsClient innerClient; + private final ScheduledEventOperationGroupsClient innerClient; private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; - public ScheduledEventsImpl(ScheduledEventsClient innerClient, + public ScheduledEventOperationGroupsImpl(ScheduledEventOperationGroupsClient innerClient, com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -49,7 +49,7 @@ public ScheduledEventApproveResponse acknowledge(String resourceGroupName, Strin } } - private ScheduledEventsClient serviceClient() { + private ScheduledEventOperationGroupsClient serviceClient() { return this.innerClient; } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdateImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdateImpl.java index 82028e518230..52356470eccf 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdateImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdateImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; @@ -8,6 +8,7 @@ import com.azure.resourcemanager.maintenance.models.ImpactType; import com.azure.resourcemanager.maintenance.models.MaintenanceScope; import com.azure.resourcemanager.maintenance.models.Update; +import com.azure.resourcemanager.maintenance.models.UpdateProperties; import com.azure.resourcemanager.maintenance.models.UpdateStatus; import java.time.OffsetDateTime; @@ -41,8 +42,8 @@ public OffsetDateTime notBefore() { return this.innerModel().notBefore(); } - public String resourceId() { - return this.innerModel().resourceId(); + public UpdateProperties properties() { + return this.innerModel().properties(); } public UpdateInner innerModel() { diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesClientImpl.java deleted file mode 100644 index 2a1e5576faf4..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesClientImpl.java +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.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.resourcemanager.maintenance.fluent.UpdatesClient; -import com.azure.resourcemanager.maintenance.fluent.models.UpdateInner; -import com.azure.resourcemanager.maintenance.models.ListUpdatesResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in UpdatesClient. - */ -public final class UpdatesClientImpl implements UpdatesClient { - /** - * The proxy service used to perform REST calls. - */ - private final UpdatesService service; - - /** - * The service client containing this operation class. - */ - private final MaintenanceManagementClientImpl client; - - /** - * Initializes an instance of UpdatesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UpdatesClientImpl(MaintenanceManagementClientImpl client) { - this.service = RestProxy.create(UpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MaintenanceManagementClientUpdates to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MaintenanceManagemen") - public interface UpdatesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listParent(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceParentType") String resourceParentType, - @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, - @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listParentSinglePageAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); - } - if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listParent(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listParentSinglePageAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceParentType == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); - } - if (resourceParentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName, - resourceParentType, resourceParentName, resourceType, resourceName, this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listParentAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listParentAsync(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context) { - return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, context)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listParent(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName) { - return new PagedIterable<>(listParentAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listParent(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context) { - return new PagedIterable<>(listParentAsync(resourceGroupName, providerName, resourceParentType, - resourceParentName, resourceType, resourceName, context)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName) { - 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 (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - providerName, resourceType, resourceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String providerName, - String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (providerName == null) { - return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName, - resourceType, resourceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String providerName, String resourceType, - String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String providerName, String resourceType, - String resourceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName, context)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String providerName, String resourceType, - String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, providerName, resourceType, resourceName)); - } - - /** - * Get Updates to resource - * - * Get updates to resources. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String providerName, String resourceType, - String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, providerName, resourceType, resourceName, context)); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesOperationGroupsClientImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesOperationGroupsClientImpl.java new file mode 100644 index 000000000000..966832d64ade --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesOperationGroupsClientImpl.java @@ -0,0 +1,804 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.maintenance.fluent.UpdatesOperationGroupsClient; +import com.azure.resourcemanager.maintenance.fluent.models.UpdateInner; +import com.azure.resourcemanager.maintenance.implementation.models.ListUpdatesResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in UpdatesOperationGroupsClient. + */ +public final class UpdatesOperationGroupsClientImpl implements UpdatesOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final UpdatesOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final MaintenanceClientImpl client; + + /** + * Initializes an instance of UpdatesOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UpdatesOperationGroupsClientImpl(MaintenanceClientImpl client) { + this.service = RestProxy.create(UpdatesOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MaintenanceClientUpdatesOperationGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "MaintenanceClientUpd") + public interface UpdatesOperationGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listParent(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listParentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName, + @PathParam("resourceParentType") String resourceParentType, + @PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType, + @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates") + @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("providerName") String providerName, + @PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listParentNext(@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 listParentNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("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); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listParentSinglePageAsync(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceParentType == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listParent(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, 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 Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listParentAsync(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName), nextLink -> listParentNextSinglePageAsync(nextLink)); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listParentSinglePage(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceParentType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listParentSinglePage(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName, + 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceParentType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.")); + } + if (resourceParentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listParentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, + resourceType, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listParent(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName) { + return new PagedIterable<>(() -> listParentSinglePage(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName), nextLink -> listParentNextSinglePage(nextLink)); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listParent(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName, + Context context) { + return new PagedIterable<>(() -> listParentSinglePage(resourceGroupName, providerName, resourceParentType, + resourceParentName, resourceType, resourceName, context), + nextLink -> listParentNextSinglePage(nextLink, context)); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + 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 (providerName == null) { + return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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, providerName, resourceType, resourceName, 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 Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String providerName, String resourceType, + String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String providerName, + String resourceType, String resourceName) { + 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName 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, providerName, resourceType, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String providerName, + String resourceType, String resourceName, 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 (providerName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter providerName is required and cannot be null.")); + } + if (resourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceName 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, providerName, resourceType, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String providerName, String resourceType, + String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, providerName, resourceType, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Get Updates to resource + * + * Get updates to resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String providerName, String resourceType, + String resourceName, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, providerName, resourceType, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get Updates to resource + * + * 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 response for Updates list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listParentNextSinglePageAsync(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.listParentNext(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 Updates to resource + * + * 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 response for Updates list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listParentNextSinglePage(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.listParentNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Updates to resource + * + * 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 response for Updates list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listParentNextSinglePage(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.listParentNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get Updates to resource + * + * 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 response for Updates list 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 Updates to resource + * + * 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 response for Updates list 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 Updates to resource + * + * 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 response for Updates list 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(UpdatesOperationGroupsClientImpl.class); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesImpl.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesOperationGroupsImpl.java similarity index 83% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesImpl.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesOperationGroupsImpl.java index 2afb370491e5..cfaa09b0901b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesImpl.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/UpdatesOperationGroupsImpl.java @@ -1,25 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.implementation; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.maintenance.fluent.UpdatesClient; +import com.azure.resourcemanager.maintenance.fluent.UpdatesOperationGroupsClient; import com.azure.resourcemanager.maintenance.fluent.models.UpdateInner; import com.azure.resourcemanager.maintenance.models.Update; -import com.azure.resourcemanager.maintenance.models.Updates; +import com.azure.resourcemanager.maintenance.models.UpdatesOperationGroups; -public final class UpdatesImpl implements Updates { - private static final ClientLogger LOGGER = new ClientLogger(UpdatesImpl.class); +public final class UpdatesOperationGroupsImpl implements UpdatesOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(UpdatesOperationGroupsImpl.class); - private final UpdatesClient innerClient; + private final UpdatesOperationGroupsClient innerClient; private final com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager; - public UpdatesImpl(UpdatesClient innerClient, + public UpdatesOperationGroupsImpl(UpdatesOperationGroupsClient innerClient, com.azure.resourcemanager.maintenance.MaintenanceManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -55,7 +55,7 @@ public PagedIterable list(String resourceGroupName, String providerName, return ResourceManagerUtils.mapPage(inner, inner1 -> new UpdateImpl(inner1, this.manager())); } - private UpdatesClient serviceClient() { + private UpdatesOperationGroupsClient serviceClient() { return this.innerClient; } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListApplyUpdate.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListApplyUpdate.java similarity index 79% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListApplyUpdate.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListApplyUpdate.java index e73e06e31b8f..d3794a33461b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListApplyUpdate.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListApplyUpdate.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.maintenance.models; +package com.azure.resourcemanager.maintenance.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * Response for ApplyUpdate list. */ -@Fluent +@Immutable public final class ListApplyUpdate implements JsonSerializable { /* * The list of apply updates */ private List value; + /* + * The link to the next page of items + */ + private String nextLink; + /** * Creates an instance of ListApplyUpdate class. */ - public ListApplyUpdate() { + private ListApplyUpdate() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: The list of apply updates. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the ListApplyUpdate object itself. + * @return the nextLink value. */ - public ListApplyUpdate withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { 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(); } @@ -88,6 +92,8 @@ public static ListApplyUpdate fromJson(JsonReader jsonReader) throws IOException if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> ApplyUpdateInner.fromJson(reader1)); deserializedListApplyUpdate.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListApplyUpdate.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListConfigurationAssignmentsResult.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListConfigurationAssignmentsResult.java similarity index 80% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListConfigurationAssignmentsResult.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListConfigurationAssignmentsResult.java index c8748c6bd886..a838d72a0625 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListConfigurationAssignmentsResult.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListConfigurationAssignmentsResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.maintenance.models; +package com.azure.resourcemanager.maintenance.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * Response for ConfigurationAssignments list. */ -@Fluent +@Immutable public final class ListConfigurationAssignmentsResult implements JsonSerializable { /* * The list of configuration Assignments */ private List value; + /* + * The link to the next page of items + */ + private String nextLink; + /** * Creates an instance of ListConfigurationAssignmentsResult class. */ - public ListConfigurationAssignmentsResult() { + private ListConfigurationAssignmentsResult() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: The list of configuration Assignments. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the ListConfigurationAssignmentsResult object itself. + * @return the nextLink value. */ - public ListConfigurationAssignmentsResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { 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(); } @@ -90,6 +94,8 @@ public static ListConfigurationAssignmentsResult fromJson(JsonReader jsonReader) List value = reader.readArray(reader1 -> ConfigurationAssignmentInner.fromJson(reader1)); deserializedListConfigurationAssignmentsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListConfigurationAssignmentsResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListMaintenanceConfigurationsResult.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListMaintenanceConfigurationsResult.java similarity index 80% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListMaintenanceConfigurationsResult.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListMaintenanceConfigurationsResult.java index 968c46a3b33c..0da0cc67a495 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListMaintenanceConfigurationsResult.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListMaintenanceConfigurationsResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.maintenance.models; +package com.azure.resourcemanager.maintenance.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Response for MaintenanceConfigurations list. */ -@Fluent +@Immutable public final class ListMaintenanceConfigurationsResult implements JsonSerializable { /* @@ -24,10 +24,15 @@ public final class ListMaintenanceConfigurationsResult */ private List value; + /* + * The link to the next page of items + */ + private String nextLink; + /** * Creates an instance of ListMaintenanceConfigurationsResult class. */ - public ListMaintenanceConfigurationsResult() { + private ListMaintenanceConfigurationsResult() { } /** @@ -40,14 +45,12 @@ public List value() { } /** - * Set the value property: The list of maintenance Configurations. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the ListMaintenanceConfigurationsResult object itself. + * @return the nextLink value. */ - public ListMaintenanceConfigurationsResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -68,6 +71,7 @@ public void validate() { 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(); } @@ -91,6 +95,8 @@ public static ListMaintenanceConfigurationsResult fromJson(JsonReader jsonReader List value = reader.readArray(reader1 -> MaintenanceConfigurationInner.fromJson(reader1)); deserializedListMaintenanceConfigurationsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListMaintenanceConfigurationsResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListUpdatesResult.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListUpdatesResult.java similarity index 79% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListUpdatesResult.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListUpdatesResult.java index e67b5f9b9b6b..edc9fb67811e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ListUpdatesResult.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/ListUpdatesResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.maintenance.models; +package com.azure.resourcemanager.maintenance.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * Response for Updates list. */ -@Fluent +@Immutable public final class ListUpdatesResult implements JsonSerializable { /* * The pending updates */ private List value; + /* + * The link to the next page of items + */ + private String nextLink; + /** * Creates an instance of ListUpdatesResult class. */ - public ListUpdatesResult() { + private ListUpdatesResult() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: The pending updates. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the ListUpdatesResult object itself. + * @return the nextLink value. */ - public ListUpdatesResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { 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(); } @@ -88,6 +92,8 @@ public static ListUpdatesResult fromJson(JsonReader jsonReader) throws IOExcepti if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> UpdateInner.fromJson(reader1)); deserializedListUpdatesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListUpdatesResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationsListResult.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/OperationsListResult.java similarity index 77% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationsListResult.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/OperationsListResult.java index 9cb915e0c4e1..d4b086f66e20 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationsListResult.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/models/OperationsListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.maintenance.models; +package com.azure.resourcemanager.maintenance.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,8 +16,13 @@ /** * Result of the List Operations operation. */ -@Fluent +@Immutable public final class OperationsListResult implements JsonSerializable { + /* + * The link used to get the next page of operations. + */ + private String nextLink; + /* * A collection of operations */ @@ -26,27 +31,25 @@ public final class OperationsListResult implements JsonSerializable value() { - return this.value; + public String nextLink() { + return this.nextLink; } /** - * Set the value property: A collection of operations. + * Get the value property: A collection of operations. * - * @param value the value value to set. - * @return the OperationsListResult object itself. + * @return the value value. */ - public OperationsListResult withValue(List value) { - this.value = value; - return this; + public List value() { + return this.value; } /** @@ -66,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,7 +89,9 @@ public static OperationsListResult fromJson(JsonReader jsonReader) throws IOExce String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedOperationsListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); deserializedOperationsListResult.value = value; } else { diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/package-info.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/package-info.java index 590bef8756bf..21e5adace3d6 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/package-info.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for MaintenanceManagementClient. + * Package containing the implementations for Maintenance. * Azure Maintenance Management Client. */ package com.azure.resourcemanager.maintenance.implementation; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ActionType.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ActionType.java new file mode 100644 index 000000000000..406b99ddc706 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdate.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdate.java index 09aada96dd85..003b6cca4e96 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdate.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateForResourceGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateForResourceGroupOperationGroups.java similarity index 80% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateForResourceGroups.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateForResourceGroupOperationGroups.java index e0317a6ef215..4c0dbaa97c99 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateForResourceGroups.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateForResourceGroupOperationGroups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -8,13 +8,13 @@ import com.azure.core.util.Context; /** - * Resource collection API of ApplyUpdateForResourceGroups. + * Resource collection API of ApplyUpdateForResourceGroupOperationGroups. */ -public interface ApplyUpdateForResourceGroups { +public interface ApplyUpdateForResourceGroupOperationGroups { /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -26,7 +26,7 @@ public interface ApplyUpdateForResourceGroups { /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateOperationGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateOperationGroups.java new file mode 100644 index 000000000000..8233167ff7bb --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdateOperationGroups.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; + +/** + * Resource collection API of ApplyUpdateOperationGroups. + */ +public interface ApplyUpdateOperationGroups { + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @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 apply Update request along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, Context context); + + /** + * Track maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + ApplyUpdate get(String resourceGroupName, String providerName, String resourceType, String resourceName, + String applyUpdateName); + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @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 apply Update request along with {@link Response}. + */ + Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, + Context context); + + /** + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param applyUpdateName The name of the ApplyUpdate. + * @param applyUpdate The ApplyUpdate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + ApplyUpdate createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, + String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate); + + /** + * Get Configuration records within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdates.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdates.java index f47815fd80c5..c086b7f4dfc7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdates.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdates.java @@ -1,30 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; /** * Resource collection API of ApplyUpdates. */ public interface ApplyUpdates { /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -36,17 +32,15 @@ Response getParentWithResponse(String resourceGroupName, String pro String applyUpdateName, Context context); /** - * Track Updates to resource with parent - * * Track maintenance updates to resource with parent. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. + * @param resourceName Resource name. + * @param applyUpdateName The name of the ApplyUpdate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -54,175 +48,4 @@ Response getParentWithResponse(String resourceGroupName, String pro */ ApplyUpdate getParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String applyUpdateName); - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, Context context); - - /** - * Track Updates to resource - * - * Track maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName applyUpdate Id. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - ApplyUpdate get(String resourceGroupName, String providerName, String resourceType, String resourceName, - String applyUpdateName); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @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 apply Update request along with {@link Response}. - */ - Response createOrUpdateOrCancelWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate, - Context context); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param applyUpdateName ApplyUpdate name. - * @param applyUpdate The ApplyUpdate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - ApplyUpdate createOrUpdateOrCancel(String resourceGroupName, String providerName, String resourceType, - String resourceName, String applyUpdateName, ApplyUpdateInner applyUpdate); - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @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 apply Update request along with {@link Response}. - */ - Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, - String resourceParentType, String resourceParentName, String resourceType, String resourceName, - Context context); - - /** - * Apply Updates to resource with parent - * - * Apply maintenance updates to resource with parent. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - ApplyUpdate createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, - String resourceParentName, String resourceType, String resourceName); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @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 apply Update request along with {@link Response}. - */ - Response createOrUpdateWithResponse(String resourceGroupName, String providerName, String resourceType, - String resourceName, Context context); - - /** - * Apply Updates to resource - * - * Apply maintenance updates to resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return apply Update request. - */ - ApplyUpdate createOrUpdate(String resourceGroupName, String providerName, String resourceType, String resourceName); - - /** - * Get Configuration records within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get Configuration records within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroups.java new file mode 100644 index 000000000000..e62b6d75f19d --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroups.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ApplyUpdatesOperationGroups. + */ +public interface ApplyUpdatesOperationGroups { + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @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 apply Update request. + */ + Response createOrUpdateParentWithResponse(String resourceGroupName, String providerName, + String resourceParentType, String resourceParentName, String resourceType, String resourceName, + Context context); + + /** + * Apply Updates to resource with parent + * + * Apply maintenance updates to resource with parent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceParentType Resource parent type. + * @param resourceParentName Resource parent identifier. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + ApplyUpdate createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, + String resourceParentName, String resourceType, String resourceName); + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @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 apply Update request. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String providerName, String resourceType, + String resourceName, Context context); + + /** + * Apply Updates to resource + * + * Apply maintenance updates to resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return apply Update request. + */ + ApplyUpdate createOrUpdate(String resourceGroupName, String providerName, String resourceType, String resourceName); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateHeaders.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateHeaders.java new file mode 100644 index 000000000000..adb504ff272a --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateHeaders.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The ApplyUpdatesOperationGroupsCreateOrUpdateHeaders model. + */ +@Immutable +public final class ApplyUpdatesOperationGroupsCreateOrUpdateHeaders { + /* + * The Retry-After property. + */ + private final Integer retryAfter; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ApplyUpdatesOperationGroupsCreateOrUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ApplyUpdatesOperationGroupsCreateOrUpdateHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } else { + this.retryAfter = null; + } + } + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders.java new file mode 100644 index 000000000000..4b4f110a7294 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders model. + */ +@Immutable +public final class ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders { + /* + * The Retry-After property. + */ + private final Integer retryAfter; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } else { + this.retryAfter = null; + } + } + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse.java new file mode 100644 index 000000000000..afab6466083c --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; + +/** + * Contains all response data for the createOrUpdateParent operation. + */ +public final class ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse + extends ResponseBase { + /** + * Creates an instance of ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse. + * + * @param request the request which resulted in this ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApplyUpdatesOperationGroupsCreateOrUpdateParentResponse(HttpRequest request, int statusCode, + HttpHeaders rawHeaders, ApplyUpdateInner value, + ApplyUpdatesOperationGroupsCreateOrUpdateParentHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ApplyUpdateInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateResponse.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateResponse.java new file mode 100644 index 000000000000..45114eea34ec --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ApplyUpdatesOperationGroupsCreateOrUpdateResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; + +/** + * Contains all response data for the createOrUpdate operation. + */ +public final class ApplyUpdatesOperationGroupsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ApplyUpdatesOperationGroupsCreateOrUpdateResponse. + * + * @param request the request which resulted in this ApplyUpdatesOperationGroupsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ApplyUpdatesOperationGroupsCreateOrUpdateResponse(HttpRequest request, int statusCode, + HttpHeaders rawHeaders, ApplyUpdateInner value, ApplyUpdatesOperationGroupsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ApplyUpdateInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignment.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignment.java index 35891814a3d0..f5f426b84a75 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignment.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentFilterProperties.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentFilterProperties.java index cf195f3c7110..63b872d83088 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentFilterProperties.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentFilterProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurationsForResourceGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentForResourceGroupOperationGroups.java similarity index 58% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurationsForResourceGroups.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentForResourceGroupOperationGroups.java index 39d5e45d3d38..aab8128ce135 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurationsForResourceGroups.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentForResourceGroupOperationGroups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -8,25 +8,32 @@ import com.azure.core.util.Context; /** - * Resource collection API of MaintenanceConfigurationsForResourceGroups. + * Resource collection API of ConfigurationAssignmentForResourceGroupOperationGroups. */ -public interface MaintenanceConfigurationsForResourceGroups { +public interface ConfigurationAssignmentForResourceGroupOperationGroups { /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return configuration records within a subscription and resource group as paginated response with * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(String resourceGroupName, String providerName, String resourceType, + String resourceName); /** * Get Configuration records within a subscription and resource group. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource type. + * @param resourceName Resource identifier. * @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. @@ -34,5 +41,6 @@ public interface MaintenanceConfigurationsForResourceGroups { * @return configuration records within a subscription and resource group as paginated response with * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String providerName, String resourceType, + String resourceName, Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentOperationGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentOperationGroups.java new file mode 100644 index 000000000000..bc2745dfd2fa --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentOperationGroups.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; + +/** + * Resource collection API of ConfigurationAssignmentOperationGroups. + */ +public interface ConfigurationAssignmentOperationGroups { + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, Context context); + + /** + * Get configuration assignment for resource.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration assignment for resource. + */ + ConfigurationAssignment get(String resourceGroupName, String providerName, String resourceType, String resourceName, + String configurationAssignmentName); + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, + ConfigurationAssignmentInner configurationAssignment, Context context); + + /** + * Register configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param configurationAssignment The configurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + ConfigurationAssignment createOrUpdate(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment along with {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String providerName, + String resourceType, String resourceName, String configurationAssignmentName, Context context); + + /** + * Unregister configuration for resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param providerName Resource provider name. + * @param resourceType Resource parent type. + * @param resourceName Resource parent name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration Assignment. + */ + ConfigurationAssignment delete(String resourceGroupName, String providerName, String resourceType, + String resourceName, String configurationAssignmentName); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignments.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignments.java index b2030f376c41..ebb341e052c3 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignments.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -14,17 +14,15 @@ */ public interface ConfigurationAssignments { /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -36,17 +34,15 @@ Response getParentWithResponse(String resourceGroupName String configurationAssignmentName, Context context); /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -56,17 +52,15 @@ ConfigurationAssignment getParent(String resourceGroupName, String providerName, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,17 +73,15 @@ Response createOrUpdateParentWithResponse(String resour String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -101,17 +93,15 @@ ConfigurationAssignment createOrUpdateParent(String resourceGroupName, String pr String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -123,17 +113,15 @@ Response deleteParentWithResponse(String resourceGroupN String configurationAssignmentName, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceName Resource name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -143,130 +131,14 @@ ConfigurationAssignment deleteParent(String resourceGroupName, String providerNa String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName); /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context); - - /** - * Get configuration assignment - * - * Get configuration assignment for resource.. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. - */ - ConfigurationAssignment get(String resourceGroupName, String providerName, String resourceType, String resourceName, - String configurationAssignmentName); - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - Response createOrUpdateWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, - ConfigurationAssignmentInner configurationAssignment, Context context); - - /** - * Create configuration assignment - * - * Register configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Configuration assignment name. - * @param configurationAssignment The configurationAssignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. - */ - ConfigurationAssignment createOrUpdate(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment); - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment along with {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String providerName, - String resourceType, String resourceName, String configurationAssignmentName, Context context); - - /** - * Unregister configuration for resource - * - * Unregister configuration for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param configurationAssignmentName Unique configuration assignment name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration Assignment. - */ - ConfigurationAssignment delete(String resourceGroupName, String providerName, String resourceType, - String resourceName, String configurationAssignmentName); - - /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -276,16 +148,14 @@ PagedIterable listParent(String resourceGroupName, Stri String resourceParentType, String resourceParentName, String resourceType, String resourceName); /** - * List configurationAssignments for resource - * * List configurationAssignments for resource. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. - * @param resourceParentName Resource parent identifier. + * @param resourceParentName Resource parent name. * @param resourceType Resource type. - * @param resourceName Resource identifier. + * @param resourceName Resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -295,39 +165,4 @@ PagedIterable listParent(String resourceGroupName, Stri PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, Context context); - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String providerName, String resourceType, - String resourceName); - - /** - * List configurationAssignments for resource - * - * List configurationAssignments for resource. - * - * @param resourceGroupName Resource group name. - * @param providerName Resource provider name. - * @param resourceType Resource type. - * @param resourceName Resource identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String providerName, String resourceType, - String resourceName, Context context); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForResourceGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForResourceGroups.java index 312c2134ad70..bcc308803a74 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForResourceGroups.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForResourceGroups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -13,12 +13,10 @@ */ public interface ConfigurationAssignmentsForResourceGroups { /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -29,12 +27,10 @@ Response getByResourceGroupWithResponse(String resource String configurationAssignmentName, Context context); /** - * Get configuration assignment - * * Get configuration assignment for resource.. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -43,12 +39,10 @@ Response getByResourceGroupWithResponse(String resource ConfigurationAssignment getByResourceGroup(String resourceGroupName, String configurationAssignmentName); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -60,12 +54,10 @@ Response createOrUpdateWithResponse(String resourceGrou String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -76,12 +68,10 @@ ConfigurationAssignment createOrUpdate(String resourceGroupName, String configur ConfigurationAssignmentInner configurationAssignment); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -93,12 +83,10 @@ Response updateWithResponse(String resourceGroupName, S ConfigurationAssignmentInner configurationAssignment, Context context); /** - * Create configuration assignment - * * Register configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param configurationAssignment The configurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -109,12 +97,10 @@ ConfigurationAssignment update(String resourceGroupName, String configurationAss ConfigurationAssignmentInner configurationAssignment); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -125,12 +111,10 @@ Response deleteByResourceGroupWithResponse(String resou String configurationAssignmentName, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param resourceGroupName Resource group name. - * @param configurationAssignmentName Unique configuration assignment name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForSubscriptions.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForSubscriptions.java index 5a77befb5993..142d7d4bf103 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForSubscriptions.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsForSubscriptions.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -12,25 +13,21 @@ */ public interface ConfigurationAssignmentsForSubscriptions { /** - * Get configuration assignment + * Get configuration assignment for resource. * - * Get configuration assignment for resource.. - * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. + * @return configuration assignment for resource along with {@link Response}. */ Response getWithResponse(String configurationAssignmentName, Context context); /** - * Get configuration assignment - * - * Get configuration assignment for resource.. + * Get configuration assignment for resource. * - * @param configurationAssignmentName Configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -39,11 +36,9 @@ public interface ConfigurationAssignmentsForSubscriptions { ConfigurationAssignment get(String configurationAssignmentName); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @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. @@ -53,11 +48,9 @@ public interface ConfigurationAssignmentsForSubscriptions { Response deleteWithResponse(String configurationAssignmentName, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * - * @param configurationAssignmentName Unique configuration assignment name. + * @param configurationAssignmentName The name of the ConfigurationAssignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -66,35 +59,49 @@ public interface ConfigurationAssignmentsForSubscriptions { ConfigurationAssignment delete(String configurationAssignmentName); /** - * Get configuration assignment + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * [UNSUPPORTED] Get configuration assignment within a subscription. This API is not implemented yet. * - * Get configuration assignment for resource.. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get configuration assignment for resource. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. + * @return configuration assignment for resource along with {@link Response}. */ ConfigurationAssignment getById(String id); /** - * Get configuration assignment - * - * Get configuration assignment for resource.. + * Get configuration assignment for resource. * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment for resource. along with {@link Response}. + * @return configuration assignment for resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * * @param id the resource ID. @@ -106,8 +113,6 @@ public interface ConfigurationAssignmentsForSubscriptions { ConfigurationAssignment deleteById(String id); /** - * Unregister configuration for resource - * * Unregister configuration for resource. * * @param id the resource ID. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsWithinSubscriptions.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsWithinSubscriptions.java deleted file mode 100644 index bf831aaae36c..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ConfigurationAssignmentsWithinSubscriptions.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of ConfigurationAssignmentsWithinSubscriptions. - */ -public interface ConfigurationAssignmentsWithinSubscriptions { - /** - * Get configuration assignment within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get configuration assignment within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration assignment within a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ImpactType.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ImpactType.java index 82c533bc59bd..68c0a92db693 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ImpactType.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ImpactType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -12,22 +12,22 @@ */ public final class ImpactType extends ExpandableStringEnum { /** - * Static value None for ImpactType. + * Pending updates has no impact on resource. */ public static final ImpactType NONE = fromString("None"); /** - * Static value Freeze for ImpactType. + * Pending updates can freeze network or disk io operation on resource. */ public static final ImpactType FREEZE = fromString("Freeze"); /** - * Static value Restart for ImpactType. + * Pending updates can cause resource to restart. */ public static final ImpactType RESTART = fromString("Restart"); /** - * Static value Redeploy for ImpactType. + * Pending updates can redeploy resource. */ public static final ImpactType REDEPLOY = fromString("Redeploy"); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputLinuxParameters.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputLinuxParameters.java index 7251231d8dd4..84d548883e27 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputLinuxParameters.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputLinuxParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -28,7 +28,7 @@ public final class InputLinuxParameters implements JsonSerializable packageNameMasksToInclude; /* - * Classification category of patches to be patched + * Classification category of patches to be patched. Allowed values are 'Critical', 'Security', and 'Other'. */ private List classificationsToInclude; @@ -79,7 +79,8 @@ public InputLinuxParameters withPackageNameMasksToInclude(List packageNa } /** - * Get the classificationsToInclude property: Classification category of patches to be patched. + * Get the classificationsToInclude property: Classification category of patches to be patched. Allowed values are + * 'Critical', 'Security', and 'Other'. * * @return the classificationsToInclude value. */ @@ -88,7 +89,8 @@ public List classificationsToInclude() { } /** - * Set the classificationsToInclude property: Classification category of patches to be patched. + * Set the classificationsToInclude property: Classification category of patches to be patched. Allowed values are + * 'Critical', 'Security', and 'Other'. * * @param classificationsToInclude the classificationsToInclude value to set. * @return the InputLinuxParameters object itself. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputPatchConfiguration.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputPatchConfiguration.java index 4b218dc84df3..5ebb0d95ac81 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputPatchConfiguration.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputPatchConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputWindowsParameters.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputWindowsParameters.java index ce1745632f6e..de07bd12d024 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputWindowsParameters.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/InputWindowsParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -28,7 +28,8 @@ public final class InputWindowsParameters implements JsonSerializable kbNumbersToInclude; /* - * Classification category of patches to be patched + * Classification category of patches to be patched. Allowed values are 'Critical', 'Security', 'UpdateRollup', + * 'FeaturePack', 'ServicePack', 'Definition', 'Tools', and 'Updates'. */ private List classificationsToInclude; @@ -84,7 +85,8 @@ public InputWindowsParameters withKbNumbersToInclude(List kbNumbersToInc } /** - * Get the classificationsToInclude property: Classification category of patches to be patched. + * Get the classificationsToInclude property: Classification category of patches to be patched. Allowed values are + * 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', and 'Updates'. * * @return the classificationsToInclude value. */ @@ -93,7 +95,8 @@ public List classificationsToInclude() { } /** - * Set the classificationsToInclude property: Classification category of patches to be patched. + * Set the classificationsToInclude property: Classification category of patches to be patched. Allowed values are + * 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', 'Tools', and 'Updates'. * * @param classificationsToInclude the classificationsToInclude value to set. * @return the InputWindowsParameters object itself. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfiguration.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfiguration.java index e8ce4465121f..37e29949e3a3 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfiguration.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -36,14 +36,14 @@ public interface MaintenanceConfiguration { String type(); /** - * Gets the location property: Gets or sets location of the resource. + * Gets the location property: The geo-location where the resource lives. * * @return the location value. */ String location(); /** - * Gets the tags property: Gets or sets tags of the resource. + * Gets the tags property: Resource tags. * * @return the tags value. */ @@ -175,8 +175,8 @@ public interface MaintenanceConfiguration { /** * The entirety of the MaintenanceConfiguration definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } /** @@ -186,7 +186,28 @@ interface DefinitionStages { /** * The first stage of the MaintenanceConfiguration definition. */ - interface Blank extends WithResourceGroup { + interface Blank extends WithLocation { + } + + /** + * The stage of the MaintenanceConfiguration definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); } /** @@ -196,7 +217,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName Resource Group Name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithCreate withExistingResourceGroup(String resourceGroupName); @@ -206,8 +227,8 @@ interface WithResourceGroup { * The stage of the MaintenanceConfiguration definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithNamespace, DefinitionStages.WithExtensionProperties, + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithNamespace, DefinitionStages.WithExtensionProperties, DefinitionStages.WithMaintenanceScope, DefinitionStages.WithVisibility, DefinitionStages.WithInstallPatches, DefinitionStages.WithStartDateTime, DefinitionStages.WithExpirationDateTime, DefinitionStages.WithDuration, DefinitionStages.WithTimeZone, DefinitionStages.WithRecurEvery { @@ -227,35 +248,14 @@ interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.Wit MaintenanceConfiguration create(Context context); } - /** - * The stage of the MaintenanceConfiguration definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location Gets or sets location of the resource. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location Gets or sets location of the resource. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - /** * The stage of the MaintenanceConfiguration definition allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Gets or sets tags of the resource. + * Specifies the tags property: Resource tags.. * - * @param tags Gets or sets tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); @@ -470,9 +470,9 @@ interface UpdateStages { */ interface WithTags { /** - * Specifies the tags property: Gets or sets tags of the resource. + * Specifies the tags property: Resource tags.. * - * @param tags Gets or sets tags of the resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurationOperationGroups.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurationOperationGroups.java new file mode 100644 index 000000000000..6f64b39cec35 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurationOperationGroups.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.maintenance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of MaintenanceConfigurationOperationGroups. + */ +public interface MaintenanceConfigurationOperationGroups { + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Get Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record. + */ + MaintenanceConfiguration getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @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 maintenance configuration record type along with {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Delete Configuration record. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the MaintenanceConfiguration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type. + */ + MaintenanceConfiguration deleteByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get Configuration records within a subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription and resource group as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get Configuration records within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get Configuration records within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get Configuration record. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record along with {@link Response}. + */ + MaintenanceConfiguration getById(String id); + + /** + * Get Configuration record. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration record along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Configuration record. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + MaintenanceConfiguration deleteById(String id); + + /** + * Delete Configuration record. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return maintenance configuration record type along with {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MaintenanceConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new MaintenanceConfiguration definition. + */ + MaintenanceConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurations.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurations.java index 728b4ba78559..b40ef47ff472 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurations.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceConfigurations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -13,128 +13,45 @@ */ public interface MaintenanceConfigurations { /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response}. + * @return public Maintenance Configuration record along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); + Response getWithResponse(String resourceName, Context context); /** - * Get Configuration record. + * Get Public Maintenance Configuration record. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. + * @param resourceName The name of the MaintenanceConfiguration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record. + * @return public Maintenance Configuration record. */ - MaintenanceConfiguration getByResourceGroup(String resourceGroupName, String resourceName); + MaintenanceConfiguration get(String resourceName); /** - * Delete Configuration record. + * Get Public Maintenance Configuration records. * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Delete Configuration record. - * - * @param resourceGroupName Resource Group Name. - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type. - */ - MaintenanceConfiguration deleteByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Get Configuration records within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. */ PagedIterable list(); /** - * Get Configuration records within a subscription. + * Get Public Maintenance Configuration records. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration records within a subscription as paginated response with {@link PagedIterable}. + * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); - - /** - * Get Configuration record. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response}. - */ - MaintenanceConfiguration getById(String id); - - /** - * Get Configuration record. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configuration record along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete Configuration record. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - MaintenanceConfiguration deleteById(String id); - - /** - * Delete Configuration record. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return maintenance configuration record type along with {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new MaintenanceConfiguration resource. - * - * @param name resource name. - * @return the first stage of the new MaintenanceConfiguration definition. - */ - MaintenanceConfiguration.DefinitionStages.Blank define(String name); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceScope.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceScope.java index 1afd1ee95216..d77e90701382 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceScope.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/MaintenanceScope.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -12,37 +12,38 @@ */ public final class MaintenanceScope extends ExpandableStringEnum { /** - * Static value Host for MaintenanceScope. + * This maintenance scope controls installation of azure platform updates i.e. services on physical nodes hosting + * customer VMs. */ public static final MaintenanceScope HOST = fromString("Host"); /** - * Static value Resource for MaintenanceScope. + * This maintenance scope controls the default update maintenance of the Azure Resource. */ public static final MaintenanceScope RESOURCE = fromString("Resource"); /** - * Static value OSImage for MaintenanceScope. + * This maintenance scope controls os image installation on VM/VMSS. */ public static final MaintenanceScope OSIMAGE = fromString("OSImage"); /** - * Static value Extension for MaintenanceScope. + * This maintenance scope controls extension installation on VM/VMSS. */ public static final MaintenanceScope EXTENSION = fromString("Extension"); /** - * Static value InGuestPatch for MaintenanceScope. + * This maintenance scope controls installation of windows and linux packages on VM/VMSS. */ public static final MaintenanceScope IN_GUEST_PATCH = fromString("InGuestPatch"); /** - * Static value SQLDB for MaintenanceScope. + * This maintenance scope controls installation of SQL server platform updates. */ public static final MaintenanceScope SQLDB = fromString("SQLDB"); /** - * Static value SQLManagedInstance for MaintenanceScope. + * This maintenance scope controls installation of SQL managed instance platform update. */ public static final MaintenanceScope SQLMANAGED_INSTANCE = fromString("SQLManagedInstance"); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operation.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operation.java index 0bf8b957f100..f3606525e92d 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operation.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -11,39 +11,43 @@ */ public interface Operation { /** - * Gets the name property: Name of the operation. + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ String name(); /** - * Gets the display property: Display name of the operation. + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. * - * @return the display value. + * @return the isDataAction value. */ - OperationInfo display(); + Boolean isDataAction(); /** - * Gets the origin property: Origin of the operation. + * Gets the display property: Localized display information for this particular operation. * - * @return the origin value. + * @return the display value. */ - String origin(); + OperationDisplay display(); /** - * Gets the properties property: Properties of the operation. + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * - * @return the properties value. + * @return the origin value. */ - Object properties(); + Origin origin(); /** - * Gets the isDataAction property: Indicates whether the operation is a data action. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @return the isDataAction value. + * @return the actionType value. */ - Boolean isDataAction(); + ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.maintenance.fluent.models.OperationInner object. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationDisplay.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationDisplay.java new file mode 100644 index 000000000000..e78bf35ac3c0 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.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; + +/** + * Localized display information for and operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * 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 OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationInfo.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationInfo.java deleted file mode 100644 index 6d763fe50d9d..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/OperationInfo.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Information about an operation. - */ -@Fluent -public final class OperationInfo implements JsonSerializable { - /* - * Name of the provider - */ - private String provider; - - /* - * Name of the resource type - */ - private String resource; - - /* - * Name of the operation - */ - private String operation; - - /* - * Description of the operation - */ - private String description; - - /** - * Creates an instance of OperationInfo class. - */ - public OperationInfo() { - } - - /** - * Get the provider property: Name of the provider. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Name of the provider. - * - * @param provider the provider value to set. - * @return the OperationInfo object itself. - */ - public OperationInfo withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Name of the resource type. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Name of the resource type. - * - * @param resource the resource value to set. - * @return the OperationInfo object itself. - */ - public OperationInfo withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Name of the operation. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Name of the operation. - * - * @param operation the operation value to set. - * @return the OperationInfo object itself. - */ - public OperationInfo withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationInfo object itself. - */ - public OperationInfo withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInfo 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 OperationInfo. - */ - public static OperationInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInfo deserializedOperationInfo = new OperationInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationInfo.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationInfo.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationInfo.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationInfo.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInfo; - }); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operations.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operations.java index b5b1255f21c3..0da2dae42140 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operations.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -14,7 +14,7 @@ public interface Operations { /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -25,7 +25,7 @@ public interface Operations { /** * List available operations * - * List the available operations supported by the Microsoft.Maintenance resource provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Origin.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Origin.java new file mode 100644 index 000000000000..6572272e707d --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/PublicMaintenanceConfigurations.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/PublicMaintenanceConfigurations.java deleted file mode 100644 index 7aec9dfe5f60..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/PublicMaintenanceConfigurations.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of PublicMaintenanceConfigurations. - */ -public interface PublicMaintenanceConfigurations { - /** - * Get Public Maintenance Configuration records. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration records as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get Public Maintenance Configuration records. - * - * @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 public Maintenance Configuration records as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record along with {@link Response}. - */ - Response getWithResponse(String resourceName, Context context); - - /** - * Get Public Maintenance Configuration record. - * - * @param resourceName Maintenance Configuration Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return public Maintenance Configuration record. - */ - MaintenanceConfiguration get(String resourceName); -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/RebootOptions.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/RebootOptions.java index 9745d3b6f468..1497ad40801c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/RebootOptions.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/RebootOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventApproveResponse.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventApproveResponse.java index 43dc5bc331b2..5c92e635f29f 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventApproveResponse.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventApproveResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEvents.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventOperationGroups.java similarity index 92% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEvents.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventOperationGroups.java index 6112bcb6c3f3..64058d226632 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEvents.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/ScheduledEventOperationGroups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -8,9 +8,9 @@ import com.azure.core.util.Context; /** - * Resource collection API of ScheduledEvents. + * Resource collection API of ScheduledEventOperationGroups. */ -public interface ScheduledEvents { +public interface ScheduledEventOperationGroups { /** * Post Scheduled Event Acknowledgement. * diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagOperators.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagOperators.java index 75bc83d8e295..6325b5f91232 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagOperators.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagOperators.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagSettingsProperties.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagSettingsProperties.java index c331981c2574..f53cdab10659 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagSettingsProperties.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/TagSettingsProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Update.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Update.java index a99a0349479c..b547a0dbd92e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Update.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Update.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -48,11 +48,11 @@ public interface Update { OffsetDateTime notBefore(); /** - * Gets the resourceId property: The resourceId. + * Gets the properties property: Properties of the apply update. * - * @return the resourceId value. + * @return the properties value. */ - String resourceId(); + UpdateProperties properties(); /** * Gets the inner com.azure.resourcemanager.maintenance.fluent.models.UpdateInner object. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateProperties.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/UpdateProperties.java similarity index 81% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateProperties.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/UpdateProperties.java index 4cbca836e0f5..fa355acb39b7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/fluent/models/UpdateProperties.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/UpdateProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.maintenance.fluent.models; +package com.azure.resourcemanager.maintenance.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Properties for update. */ -@Fluent +@Immutable public final class UpdateProperties implements JsonSerializable { /* * The resourceId @@ -24,7 +24,7 @@ public final class UpdateProperties implements JsonSerializable { /** - * Static value Pending for UpdateStatus. + * There are pending updates to be installed. */ public static final UpdateStatus PENDING = fromString("Pending"); /** - * Static value InProgress for UpdateStatus. + * Updates installation are in progress. */ public static final UpdateStatus IN_PROGRESS = fromString("InProgress"); /** - * Static value Completed for UpdateStatus. + * All updates are successfully applied. */ public static final UpdateStatus COMPLETED = fromString("Completed"); /** - * Static value RetryNow for UpdateStatus. + * Updates installation failed but are ready to retry again. */ public static final UpdateStatus RETRY_NOW = fromString("RetryNow"); /** - * Static value RetryLater for UpdateStatus. + * Updates installation failed and should be retried later. */ public static final UpdateStatus RETRY_LATER = fromString("RetryLater"); /** - * Static value NoUpdatesPending for UpdateStatus. + * No updates are pending. */ public static final UpdateStatus NO_UPDATES_PENDING = fromString("NoUpdatesPending"); /** - * Static value Cancel for UpdateStatus. + * Cancel the schedule and stop creating PMR for resources part of it. Applicable to Maintenance Configuration + * resource type only. */ public static final UpdateStatus CANCEL = fromString("Cancel"); /** - * Static value Cancelled for UpdateStatus. + * Send the Cancelled response to the user if request came to cancel the schedule. Applicable to Maintenance + * Configuration resource type only. */ public static final UpdateStatus CANCELLED = fromString("Cancelled"); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Updates.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/UpdatesOperationGroups.java similarity index 76% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Updates.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/UpdatesOperationGroups.java index c9ef4c7a863c..44773374a458 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Updates.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/UpdatesOperationGroups.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -8,15 +8,15 @@ import com.azure.core.util.Context; /** - * Resource collection API of Updates. + * Resource collection API of UpdatesOperationGroups. */ -public interface Updates { +public interface UpdatesOperationGroups { /** * Get Updates to resource * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. * @param resourceParentName Resource parent identifier. @@ -25,7 +25,9 @@ public interface Updates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName); @@ -35,7 +37,7 @@ PagedIterable listParent(String resourceGroupName, String providerName, * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceParentType Resource parent type. * @param resourceParentName Resource parent identifier. @@ -45,7 +47,9 @@ PagedIterable listParent(String resourceGroupName, String providerName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ PagedIterable listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, Context context); @@ -55,14 +59,16 @@ PagedIterable listParent(String resourceGroupName, String providerName, * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceType Resource type. * @param resourceName Resource identifier. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String providerName, String resourceType, String resourceName); @@ -71,7 +77,7 @@ PagedIterable listParent(String resourceGroupName, String providerName, * * Get updates to resources. * - * @param resourceGroupName Resource group name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param providerName Resource provider name. * @param resourceType Resource type. * @param resourceName Resource identifier. @@ -79,7 +85,9 @@ PagedIterable listParent(String resourceGroupName, String providerName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return updates to resources as paginated response with {@link PagedIterable}. + * @return updates to resource + * + * Get updates to resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String providerName, String resourceType, String resourceName, Context context); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Visibility.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Visibility.java index 52a2abeeedb2..fdd8e3102ea9 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Visibility.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/Visibility.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.models; @@ -12,12 +12,12 @@ */ public final class Visibility extends ExpandableStringEnum { /** - * Static value Custom for Visibility. + * Only visible to users with permissions. */ public static final Visibility CUSTOM = fromString("Custom"); /** - * Static value Public for Visibility. + * Visible to all users. */ public static final Visibility PUBLIC = fromString("Public"); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/package-info.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/package-info.java index 78c81cdea035..10491797bf7c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/package-info.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for MaintenanceManagementClient. + * Package containing the data models for Maintenance. * Azure Maintenance Management Client. */ package com.azure.resourcemanager.maintenance.models; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/package-info.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/package-info.java index e8c80c13ac9a..ede4373cf3e8 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/package-info.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/com/azure/resourcemanager/maintenance/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for MaintenanceManagementClient. + * Package containing the classes for Maintenance. * Azure Maintenance Management Client. */ package com.azure.resourcemanager.maintenance; diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/module-info.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/module-info.java index 82074fbbfd21..043de8882d5c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/module-info.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.maintenance { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.maintenance.fluent.models to com.azure.core; opens com.azure.resourcemanager.maintenance.models to com.azure.core; + opens com.azure.resourcemanager.maintenance.implementation.models to com.azure.core; } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-maintenance/proxy-config.json b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-maintenance/proxy-config.json index f04ded538959..5c79c0c0e19f 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-maintenance/proxy-config.json +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-maintenance/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.maintenance.implementation.ApplyUpdateForResourceGroupsClientImpl$ApplyUpdateForResourceGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ApplyUpdatesClientImpl$ApplyUpdatesService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsClientImpl$ConfigurationAssignmentsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsForResourceGroupsClientImpl$ConfigurationAssignmentsForResourceGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsForSubscriptionsClientImpl$ConfigurationAssignmentsForSubscriptionsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsWithinSubscriptionsClientImpl$ConfigurationAssignmentsWithinSubscriptionsService"],["com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationsClientImpl$MaintenanceConfigurationsService"],["com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationsForResourceGroupsClientImpl$MaintenanceConfigurationsForResourceGroupsService"],["com.azure.resourcemanager.maintenance.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.maintenance.implementation.PublicMaintenanceConfigurationsClientImpl$PublicMaintenanceConfigurationsService"],["com.azure.resourcemanager.maintenance.implementation.ScheduledEventsClientImpl$ScheduledEventsService"],["com.azure.resourcemanager.maintenance.implementation.UpdatesClientImpl$UpdatesService"]] \ No newline at end of file +[["com.azure.resourcemanager.maintenance.implementation.ApplyUpdateForResourceGroupOperationGroupsClientImpl$ApplyUpdateForResourceGroupOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ApplyUpdateOperationGroupsClientImpl$ApplyUpdateOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ApplyUpdatesClientImpl$ApplyUpdatesService"],["com.azure.resourcemanager.maintenance.implementation.ApplyUpdatesOperationGroupsClientImpl$ApplyUpdatesOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentForResourceGroupOperationGroupsClientImpl$ConfigurationAssignmentForResourceGroupOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentOperationGroupsClientImpl$ConfigurationAssignmentOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsClientImpl$ConfigurationAssignmentsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsForResourceGroupsClientImpl$ConfigurationAssignmentsForResourceGroupsService"],["com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsForSubscriptionsClientImpl$ConfigurationAssignmentsForSubscriptionsService"],["com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationOperationGroupsClientImpl$MaintenanceConfigurationOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.MaintenanceConfigurationsClientImpl$MaintenanceConfigurationsService"],["com.azure.resourcemanager.maintenance.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.maintenance.implementation.ScheduledEventOperationGroupsClientImpl$ScheduledEventOperationGroupsService"],["com.azure.resourcemanager.maintenance.implementation.UpdatesOperationGroupsClientImpl$UpdatesOperationGroupsService"]] \ No newline at end of file diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/azure-resourcemanager-maintenance.properties b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/azure-resourcemanager-maintenance.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/main/resources/azure-resourcemanager-maintenance.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupListByResourceGroupSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupListByResourceGroupSamples.java deleted file mode 100644 index 5b3f5715d189..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupListByResourceGroupSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -/** - * Samples for ApplyUpdateForResourceGroup ListByResourceGroup. - */ -public final class ApplyUpdateForResourceGroupListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdatesResourceGroup_List.json - */ - /** - * Sample code: ApplyUpdatesResourceGroup_List. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void applyUpdatesResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdateForResourceGroups().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupOperationGroupListByResourceGroupSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupOperationGroupListByResourceGroupSamples.java new file mode 100644 index 000000000000..b4bc7e6b50ce --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupOperationGroupListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +/** + * Samples for ApplyUpdateForResourceGroupOperationGroup ListByResourceGroup. + */ +public final class ApplyUpdateForResourceGroupOperationGroupListByResourceGroupSamples { + /* + * x-ms-original-file: 2023-10-01-preview/ApplyUpdatesResourceGroup_List.json + */ + /** + * Sample code: ApplyUpdatesResourceGroup_List. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void applyUpdatesResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.applyUpdateForResourceGroupOperationGroups() + .listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateOrCancelSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupCreateOrUpdateOrCancelSamples.java similarity index 69% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateOrCancelSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupCreateOrUpdateOrCancelSamples.java index d489b42e346e..1eb56b6bc3f7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateOrCancelSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupCreateOrUpdateOrCancelSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -8,13 +8,11 @@ import com.azure.resourcemanager.maintenance.models.UpdateStatus; /** - * Samples for ApplyUpdates CreateOrUpdateOrCancel. + * Samples for ApplyUpdateOperationGroup CreateOrUpdateOrCancel. */ -public final class ApplyUpdatesCreateOrUpdateOrCancelSamples { +public final class ApplyUpdateOperationGroupCreateOrUpdateOrCancelSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdateOnly_NoCancellation.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdateOnly_NoCancellation.json */ /** * Sample code: ApplyUpdates_CreateOrUpdateOnly_NoCancellation. @@ -23,15 +21,13 @@ public final class ApplyUpdatesCreateOrUpdateOrCancelSamples { */ public static void applyUpdatesCreateOrUpdateOnlyNoCancellation(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() + manager.applyUpdateOperationGroups() .createOrUpdateOrCancelWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "20230901121200", new ApplyUpdateInner(), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdate_CancelMaintenance.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdate_CancelMaintenance.json */ /** * Sample code: ApplyUpdates_CreateOrUpdateOrCancel. @@ -40,7 +36,7 @@ public final class ApplyUpdatesCreateOrUpdateOrCancelSamples { */ public static void applyUpdatesCreateOrUpdateOrCancel(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() + manager.applyUpdateOperationGroups() .createOrUpdateOrCancelWithResponse("examplerg", "Microsoft.Maintenance", "maintenanceConfigurations", "maintenanceConfig1", "20230901121200", new ApplyUpdateInner().withStatus(UpdateStatus.CANCEL), com.azure.core.util.Context.NONE); diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupGetSamples.java similarity index 64% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupGetSamples.java index 16add0c98474..18804e39b69a 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupGetSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ApplyUpdates Get. + * Samples for ApplyUpdateOperationGroup Get. */ -public final class ApplyUpdatesGetSamples { +public final class ApplyUpdateOperationGroupGetSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_Get.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_Get.json */ /** * Sample code: ApplyUpdates_Get. @@ -19,7 +17,7 @@ public final class ApplyUpdatesGetSamples { * @param manager Entry point to MaintenanceManager. */ public static void applyUpdatesGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() + manager.applyUpdateOperationGroups() .getWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "e9b9685d-78e4-44c4-a81c-64a14f9b87b6", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupListSamples.java similarity index 52% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesListSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupListSamples.java index f517659d93dd..dc4200b1d17f 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesListSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupListSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ApplyUpdates List. + * Samples for ApplyUpdateOperationGroup List. */ -public final class ApplyUpdatesListSamples { +public final class ApplyUpdateOperationGroupListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_List.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_List.json */ /** * Sample code: ApplyUpdates_List. @@ -19,6 +17,6 @@ public final class ApplyUpdatesListSamples { * @param manager Entry point to MaintenanceManager. */ public static void applyUpdatesList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates().list(com.azure.core.util.Context.NONE); + manager.applyUpdateOperationGroups().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentSamples.java index a06feb0e80a0..1750bcbd1d76 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ApplyUpdatesGetParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_GetParent.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_GetParent.json */ /** * Sample code: ApplyUpdates_GetParent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupCreateOrUpdateParentSamples.java similarity index 62% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateParentSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupCreateOrUpdateParentSamples.java index a12c2a70e1c0..09cf1fc7a7c0 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupCreateOrUpdateParentSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ApplyUpdates CreateOrUpdateParent. + * Samples for ApplyUpdatesOperationGroup CreateOrUpdateParent. */ -public final class ApplyUpdatesCreateOrUpdateParentSamples { +public final class ApplyUpdatesOperationGroupCreateOrUpdateParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdateParent.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdateParent.json */ /** * Sample code: ApplyUpdates_CreateOrUpdateParent. @@ -20,7 +18,7 @@ public final class ApplyUpdatesCreateOrUpdateParentSamples { */ public static void applyUpdatesCreateOrUpdateParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() + manager.applyUpdatesOperationGroups() .createOrUpdateParentWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "smdvm1", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupCreateOrUpdateSamples.java similarity index 62% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupCreateOrUpdateSamples.java index 3cccad27161b..a0ab17324572 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupCreateOrUpdateSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ApplyUpdates CreateOrUpdate. + * Samples for ApplyUpdatesOperationGroup CreateOrUpdate. */ -public final class ApplyUpdatesCreateOrUpdateSamples { +public final class ApplyUpdatesOperationGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ApplyUpdates_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ApplyUpdates_CreateOrUpdate.json */ /** * Sample code: ApplyUpdates_CreateOrUpdate. @@ -19,7 +17,7 @@ public final class ApplyUpdatesCreateOrUpdateSamples { * @param manager Entry point to MaintenanceManager. */ public static void applyUpdatesCreateOrUpdate(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.applyUpdates() + manager.applyUpdatesOperationGroups() .createOrUpdateWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentForResourceGroupOperationGroupListSamples.java similarity index 60% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentForResourceGroupOperationGroupListSamples.java index 232f6359999c..de9b166b62b9 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentForResourceGroupOperationGroupListSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ConfigurationAssignments List. + * Samples for ConfigurationAssignmentForResourceGroupOperationGroup List. */ -public final class ConfigurationAssignmentsListSamples { +public final class ConfigurationAssignmentForResourceGroupOperationGroupListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_List.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_List.json */ /** * Sample code: ConfigurationAssignments_List. @@ -19,7 +17,7 @@ public final class ConfigurationAssignmentsListSamples { * @param manager Entry point to MaintenanceManager. */ public static void configurationAssignmentsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() + manager.configurationAssignmentForResourceGroupOperationGroups() .list("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupCreateOrUpdateSamples.java similarity index 71% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupCreateOrUpdateSamples.java index 8cfadb1ab30f..9c46c987df83 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupCreateOrUpdateSamples.java @@ -1,19 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; /** - * Samples for ConfigurationAssignments CreateOrUpdate. + * Samples for ConfigurationAssignmentOperationGroup CreateOrUpdate. */ -public final class ConfigurationAssignmentsCreateOrUpdateSamples { +public final class ConfigurationAssignmentOperationGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_CreateOrUpdate.json */ /** * Sample code: ConfigurationAssignments_CreateOrUpdate. @@ -22,7 +20,7 @@ public final class ConfigurationAssignmentsCreateOrUpdateSamples { */ public static void configurationAssignmentsCreateOrUpdate(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() + manager.configurationAssignmentOperationGroups() .createOrUpdateWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", new ConfigurationAssignmentInner().withMaintenanceConfigurationId( diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupDeleteSamples.java similarity index 61% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupDeleteSamples.java index 2a1d58c9192f..6780427fdb5b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupDeleteSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ConfigurationAssignments Delete. + * Samples for ConfigurationAssignmentOperationGroup Delete. */ -public final class ConfigurationAssignmentsDeleteSamples { +public final class ConfigurationAssignmentOperationGroupDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_Delete.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_Delete.json */ /** * Sample code: ConfigurationAssignments_Delete. @@ -20,7 +18,7 @@ public final class ConfigurationAssignmentsDeleteSamples { */ public static void configurationAssignmentsDelete(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() + manager.configurationAssignmentOperationGroups() .deleteWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupGetSamples.java similarity index 61% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupGetSamples.java index 50d8c61f9e56..80abf1ad267c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupGetSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ConfigurationAssignments Get. + * Samples for ConfigurationAssignmentOperationGroup Get. */ -public final class ConfigurationAssignmentsGetSamples { +public final class ConfigurationAssignmentOperationGroupGetSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_Get.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_Get.json */ /** * Sample code: ConfigurationAssignments_Get. @@ -19,7 +17,7 @@ public final class ConfigurationAssignmentsGetSamples { * @param manager Entry point to MaintenanceManager. */ public static void configurationAssignmentsGet(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignments() + manager.configurationAssignmentOperationGroups() .getWithResponse("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "workervmConfiguration", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentSamples.java index eb8ad3660255..f6e538349253 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -11,9 +11,7 @@ */ public final class ConfigurationAssignmentsCreateOrUpdateParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_CreateOrUpdateParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_CreateOrUpdateParent.json */ /** * Sample code: ConfigurationAssignments_CreateOrUpdateParent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentSamples.java index 7a66f6a7f37c..1488a0669413 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsDeleteParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_DeleteParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_DeleteParent.json */ /** * Sample code: ConfigurationAssignments_DeleteParent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples.java index 60782e3bfe0e..79e667e3a7b6 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -17,9 +17,7 @@ */ public final class ConfigurationAssignmentsForResourceGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_CreateOrUpdate.json */ /** * Sample code: ConfigurationAssignmentsForResourceGroup_CreateOrUpdate. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupDeleteSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupDeleteSamples.java index c9ff8d21dd02..254651477bbb 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupDeleteSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsForResourceGroupDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_Delete.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_Delete.json */ /** * Sample code: ConfigurationAssignmentsForResourceGroup_Delete. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples.java index 663075721bd9..73b27e70e826 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsForResourceGroupGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_Get.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_Get.json */ /** * Sample code: ConfigurationAssignmentsForResourceGroup_Get. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupUpdateSamples.java index 288d3d0cd88e..bfea622c2226 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -17,9 +17,7 @@ */ public final class ConfigurationAssignmentsForResourceGroupUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForResourceGroup_UpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForResourceGroup_UpdateForResource.json */ /** * Sample code: ConfigurationAssignmentsForResourceGroup_CreateOrUpdate. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples.java index a74bdee2b868..8f325efb6192 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -16,9 +16,7 @@ */ public final class ConfigurationAssignmentsForSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_CreateOrUpdate.json */ /** * Sample code: ConfigurationAssignmentsForSubscriptions_CreateOrUpdate. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteSamples.java index d0f11973e895..985100767fc9 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsForSubscriptionsDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_Delete.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_Delete.json */ /** * Sample code: ConfigurationAssignmentsForSubscriptions_Delete. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetSamples.java index 333f76625cd9..1683b12dc99b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsForSubscriptionsGetSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_Get.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_Get.json */ /** * Sample code: ConfigurationAssignments_GetParent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsListSamples.java new file mode 100644 index 000000000000..28bd7a657a34 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +/** + * Samples for ConfigurationAssignmentsForSubscriptions List. + */ +public final class ConfigurationAssignmentsForSubscriptionsListSamples { + /* + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsResultWithinSubscription_List.json + */ + /** + * Sample code: ConfigurationAssignmentsResultWithinSubscription_List. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void configurationAssignmentsResultWithinSubscriptionList( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.configurationAssignmentsForSubscriptions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsUpdateSamples.java index 9569a6a21b5f..0a85d02090d9 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -17,9 +17,7 @@ */ public final class ConfigurationAssignmentsForSubscriptionsUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsForSubscriptions_UpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignmentsForSubscriptions_UpdateForResource.json */ /** * Sample code: ConfigurationAssignmentsForSubscriptions_CreateOrUpdate. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentSamples.java index 1be3ca8c0e33..0855e3392224 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsGetParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_GetParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_GetParent.json */ /** * Sample code: ConfigurationAssignments_GetParent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentSamples.java index 813fb5f6700b..727ad5969da7 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class ConfigurationAssignmentsListParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignments_ListParent.json + * x-ms-original-file: 2023-10-01-preview/ConfigurationAssignments_ListParent.json */ /** * Sample code: ConfigurationAssignments_ListParent. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsWithinSubscriptionListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsWithinSubscriptionListSamples.java deleted file mode 100644 index 0f10e0ec3ac8..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsWithinSubscriptionListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -/** - * Samples for ConfigurationAssignmentsWithinSubscription List. - */ -public final class ConfigurationAssignmentsWithinSubscriptionListSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ConfigurationAssignmentsResultWithinSubscription_List.json - */ - /** - * Sample code: ConfigurationAssignmentsResultWithinSubscription_List. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void configurationAssignmentsResultWithinSubscriptionList( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.configurationAssignmentsWithinSubscriptions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupCreateOrUpdateSamples.java similarity index 73% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupCreateOrUpdateSamples.java index 7970b2c5f594..3e9e84afb8e8 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -8,13 +8,11 @@ import com.azure.resourcemanager.maintenance.models.Visibility; /** - * Samples for MaintenanceConfigurations CreateOrUpdate. + * Samples for MaintenanceConfigurationOperationGroup CreateOrUpdate. */ -public final class MaintenanceConfigurationsCreateOrUpdateSamples { +public final class MaintenanceConfigurationOperationGroupCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_CreateOrUpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_CreateOrUpdateForResource.json */ /** * Sample code: MaintenanceConfigurations_CreateOrUpdateForResource. @@ -23,10 +21,10 @@ public final class MaintenanceConfigurationsCreateOrUpdateSamples { */ public static void maintenanceConfigurationsCreateOrUpdateForResource( com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() + manager.maintenanceConfigurationOperationGroups() .define("configuration1") - .withExistingResourceGroup("examplerg") .withRegion("westus2") + .withExistingResourceGroup("examplerg") .withNamespace("Microsoft.Maintenance") .withMaintenanceScope(MaintenanceScope.OSIMAGE) .withVisibility(Visibility.CUSTOM) diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsDeleteSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupDeleteSamples.java similarity index 58% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsDeleteSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupDeleteSamples.java index dfc9f5a5f0c9..f70e8c55747d 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsDeleteSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupDeleteSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for MaintenanceConfigurations Delete. + * Samples for MaintenanceConfigurationOperationGroup Delete. */ -public final class MaintenanceConfigurationsDeleteSamples { +public final class MaintenanceConfigurationOperationGroupDeleteSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_DeleteForResource.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_DeleteForResource.json */ /** * Sample code: MaintenanceConfigurations_DeleteForResource. @@ -20,7 +18,7 @@ public final class MaintenanceConfigurationsDeleteSamples { */ public static void maintenanceConfigurationsDeleteForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() + manager.maintenanceConfigurationOperationGroups() .deleteByResourceGroupWithResponse("examplerg", "example1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetByResourceGroupSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupGetByResourceGroupSamples.java similarity index 61% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetByResourceGroupSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupGetByResourceGroupSamples.java index 582048a22d90..612a5d88a462 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetByResourceGroupSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupGetByResourceGroupSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for MaintenanceConfigurations GetByResourceGroup. + * Samples for MaintenanceConfigurationOperationGroup GetByResourceGroup. */ -public final class MaintenanceConfigurationsGetByResourceGroupSamples { +public final class MaintenanceConfigurationOperationGroupGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchWindows.json */ /** * Sample code: MaintenanceConfigurations_GetForResource_GuestOSPatchWindows. @@ -20,14 +18,12 @@ public final class MaintenanceConfigurationsGetByResourceGroupSamples { */ public static void maintenanceConfigurationsGetForResourceGuestOSPatchWindows( com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() + manager.maintenanceConfigurationOperationGroups() .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource_GuestOSPatchLinux.json */ /** * Sample code: MaintenanceConfigurations_GetForResource_GuestOSPatchLinux. @@ -36,14 +32,12 @@ public static void maintenanceConfigurationsGetForResourceGuestOSPatchWindows( */ public static void maintenanceConfigurationsGetForResourceGuestOSPatchLinux( com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() + manager.maintenanceConfigurationOperationGroups() .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_GetForResource.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_GetForResource.json */ /** * Sample code: MaintenanceConfigurations_GetForResource. @@ -52,7 +46,7 @@ public static void maintenanceConfigurationsGetForResourceGuestOSPatchLinux( */ public static void maintenanceConfigurationsGetForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurations() + manager.maintenanceConfigurationOperationGroups() .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsForResourceGroupListByResourceGroupSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupListByResourceGroupSamples.java similarity index 53% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsForResourceGroupListByResourceGroupSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupListByResourceGroupSamples.java index 5276dc50153f..59385f625293 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsForResourceGroupListByResourceGroupSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupListByResourceGroupSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for MaintenanceConfigurationsForResourceGroup ListByResourceGroup. + * Samples for MaintenanceConfigurationOperationGroup ListByResourceGroup. */ -public final class MaintenanceConfigurationsForResourceGroupListByResourceGroupSamples { +public final class MaintenanceConfigurationOperationGroupListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurationsResourceGroup_List.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurationsResourceGroup_List.json */ /** * Sample code: MaintenanceConfigurationsResourceGroup_List. @@ -20,7 +18,7 @@ public final class MaintenanceConfigurationsForResourceGroupListByResourceGroupS */ public static void maintenanceConfigurationsResourceGroupList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.maintenanceConfigurationsForResourceGroups() + manager.maintenanceConfigurationOperationGroups() .listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupListSamples.java new file mode 100644 index 000000000000..8e49dfca7f53 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +/** + * Samples for MaintenanceConfigurationOperationGroup List. + */ +public final class MaintenanceConfigurationOperationGroupListSamples { + /* + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_List.json + */ + /** + * Sample code: MaintenanceConfigurations_List. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void maintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurationOperationGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsUpdateSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupUpdateSamples.java similarity index 77% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsUpdateSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupUpdateSamples.java index 24952acecb5b..879359b82bab 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsUpdateSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,13 +9,11 @@ import com.azure.resourcemanager.maintenance.models.Visibility; /** - * Samples for MaintenanceConfigurations Update. + * Samples for MaintenanceConfigurationOperationGroup Update. */ -public final class MaintenanceConfigurationsUpdateSamples { +public final class MaintenanceConfigurationOperationGroupUpdateSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_UpdateForResource.json + * x-ms-original-file: 2023-10-01-preview/MaintenanceConfigurations_UpdateForResource.json */ /** * Sample code: MaintenanceConfigurations_UpdateForResource. @@ -24,7 +22,7 @@ public final class MaintenanceConfigurationsUpdateSamples { */ public static void maintenanceConfigurationsUpdateForResource(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - MaintenanceConfiguration resource = manager.maintenanceConfigurations() + MaintenanceConfiguration resource = manager.maintenanceConfigurationOperationGroups() .getByResourceGroupWithResponse("examplerg", "configuration1", com.azure.core.util.Context.NONE) .getValue(); resource.update() diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetSamples.java new file mode 100644 index 000000000000..5e1da426d9df --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +/** + * Samples for MaintenanceConfigurations Get. + */ +public final class MaintenanceConfigurationsGetSamples { + /* + * x-ms-original-file: 2023-10-01-preview/PublicMaintenanceConfigurations_GetForResource.json + */ + /** + * Sample code: PublicMaintenanceConfigurations_GetForResource. + * + * @param manager Entry point to MaintenanceManager. + */ + public static void publicMaintenanceConfigurationsGetForResource( + com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + manager.maintenanceConfigurations().getWithResponse("configuration1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListSamples.java index 199aa2f511c5..3de8f957eafa 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,16 +9,15 @@ */ public final class MaintenanceConfigurationsListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * MaintenanceConfigurations_List.json + * x-ms-original-file: 2023-10-01-preview/PublicMaintenanceConfigurations_List.json */ /** - * Sample code: MaintenanceConfigurations_List. + * Sample code: PublicMaintenanceConfigurations_List. * * @param manager Entry point to MaintenanceManager. */ - public static void maintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { + public static void + publicMaintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { manager.maintenanceConfigurations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/OperationsListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/OperationsListSamples.java index 24f6c2ac4b49..f987aed8e173 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/OperationsListSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * Operations_List.json + * x-ms-original-file: 2023-10-01-preview/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsGetSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsGetSamples.java deleted file mode 100644 index 816e1ae65ad1..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -/** - * Samples for PublicMaintenanceConfigurations Get. - */ -public final class PublicMaintenanceConfigurationsGetSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * PublicMaintenanceConfigurations_GetForResource.json - */ - /** - * Sample code: PublicMaintenanceConfigurations_GetForResource. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void publicMaintenanceConfigurationsGetForResource( - com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.publicMaintenanceConfigurations().getWithResponse("configuration1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsListSamples.java deleted file mode 100644 index d99a1bcb5678..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -/** - * Samples for PublicMaintenanceConfigurations List. - */ -public final class PublicMaintenanceConfigurationsListSamples { - /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * PublicMaintenanceConfigurations_List.json - */ - /** - * Sample code: PublicMaintenanceConfigurations_List. - * - * @param manager Entry point to MaintenanceManager. - */ - public static void - publicMaintenanceConfigurationsList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.publicMaintenanceConfigurations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventAcknowledgeSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventOperationGroupAcknowledgeSamples.java similarity index 62% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventAcknowledgeSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventOperationGroupAcknowledgeSamples.java index 33ed8f09ad1a..88d6834a6343 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventAcknowledgeSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventOperationGroupAcknowledgeSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for ScheduledEvent Acknowledge. + * Samples for ScheduledEventOperationGroup Acknowledge. */ -public final class ScheduledEventAcknowledgeSamples { +public final class ScheduledEventOperationGroupAcknowledgeSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * ScheduledEvents_Acknowledge.json + * x-ms-original-file: 2023-10-01-preview/ScheduledEvents_Acknowledge.json */ /** * Sample code: ScheduledEvents_Acknowledge. @@ -19,7 +17,7 @@ public final class ScheduledEventAcknowledgeSamples { * @param manager Entry point to MaintenanceManager. */ public static void scheduledEventsAcknowledge(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.scheduledEvents() + manager.scheduledEventOperationGroups() .acknowledgeWithResponse("examplerg", "virtualMachines", "configuration1", "ad6d85cf-2c9e-4eec-9a1e-af3213cc0486", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesListParentSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupListParentSamples.java similarity index 63% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesListParentSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupListParentSamples.java index 69a858db455d..29a242500d22 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesListParentSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupListParentSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for Updates ListParent. + * Samples for UpdatesOperationGroup ListParent. */ -public final class UpdatesListParentSamples { +public final class UpdatesOperationGroupListParentSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/ - * Updates_ListParent.json + * x-ms-original-file: 2023-10-01-preview/Updates_ListParent.json */ /** * Sample code: Updates_ListParent. @@ -19,7 +17,7 @@ public final class UpdatesListParentSamples { * @param manager Entry point to MaintenanceManager. */ public static void updatesListParent(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.updates() + manager.updatesOperationGroups() .listParent("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", "virtualMachines", "1", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesListSamples.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupListSamples.java similarity index 63% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesListSamples.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupListSamples.java index f184e36a6404..08133b97d3b5 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesListSamples.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/samples/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupListSamples.java @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; /** - * Samples for Updates List. + * Samples for UpdatesOperationGroup List. */ -public final class UpdatesListSamples { +public final class UpdatesOperationGroupListSamples { /* - * x-ms-original-file: - * specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-10-01-preview/examples/Updates_List - * .json + * x-ms-original-file: 2023-10-01-preview/Updates_List.json */ /** * Sample code: Updates_List. @@ -19,7 +17,7 @@ public final class UpdatesListSamples { * @param manager Entry point to MaintenanceManager. */ public static void updatesList(com.azure.resourcemanager.maintenance.MaintenanceManager manager) { - manager.updates() + manager.updatesOperationGroups() .list("examplerg", "Microsoft.Compute", "virtualMachineScaleSets", "smdtest1", com.azure.core.util.Context.NONE); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupsListByResourceGroupMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupOperationGroupsListByResourceGroupMockTests.java similarity index 61% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupsListByResourceGroupMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupOperationGroupsListByResourceGroupMockTests.java index 894cafc1eebd..0e7a894eaa97 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupsListByResourceGroupMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateForResourceGroupOperationGroupsListByResourceGroupMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; @@ -19,25 +19,25 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ApplyUpdateForResourceGroupsListByResourceGroupMockTests { +public final class ApplyUpdateForResourceGroupOperationGroupsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"Cancelled\",\"resourceId\":\"jnaeois\",\"lastUpdateTime\":\"2021-10-16T19:23:29Z\"},\"id\":\"gorf\",\"name\":\"ukiscvwmzhw\",\"type\":\"lefaxvxilcbtgn\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"RetryLater\",\"resourceId\":\"idizozsdbccxjmo\",\"lastUpdateTime\":\"2021-10-01T00:52:35Z\"},\"id\":\"nwncypuuw\",\"name\":\"ltv\",\"type\":\"qjctzenkeif\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.applyUpdateForResourceGroups() - .listByResourceGroup("cdyuibhmfdnbzyd", com.azure.core.util.Context.NONE); + PagedIterable response = manager.applyUpdateForResourceGroupOperationGroups() + .listByResourceGroup("lpmjerb", com.azure.core.util.Context.NONE); - Assertions.assertEquals(UpdateStatus.CANCELLED, response.iterator().next().status()); - Assertions.assertEquals("jnaeois", response.iterator().next().resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-16T19:23:29Z"), + Assertions.assertEquals(UpdateStatus.RETRY_LATER, response.iterator().next().status()); + Assertions.assertEquals("idizozsdbccxjmo", response.iterator().next().resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T00:52:35Z"), response.iterator().next().lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateInnerTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateInnerTests.java deleted file mode 100644 index 1a6ebe67992d..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; -import com.azure.resourcemanager.maintenance.models.UpdateStatus; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ApplyUpdateInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplyUpdateInner model = BinaryData.fromString( - "{\"properties\":{\"status\":\"RetryNow\",\"resourceId\":\"ku\",\"lastUpdateTime\":\"2021-10-04T05:41:09Z\"},\"id\":\"kg\",\"name\":\"sauuimj\",\"type\":\"vxieduugidyj\"}") - .toObject(ApplyUpdateInner.class); - Assertions.assertEquals(UpdateStatus.RETRY_NOW, model.status()); - Assertions.assertEquals("ku", model.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T05:41:09Z"), model.lastUpdateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplyUpdateInner model = new ApplyUpdateInner().withStatus(UpdateStatus.RETRY_NOW) - .withResourceId("ku") - .withLastUpdateTime(OffsetDateTime.parse("2021-10-04T05:41:09Z")); - model = BinaryData.fromObject(model).toObject(ApplyUpdateInner.class); - Assertions.assertEquals(UpdateStatus.RETRY_NOW, model.status()); - Assertions.assertEquals("ku", model.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T05:41:09Z"), model.lastUpdateTime()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateOrCancelWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsCreateOrUpdateOrCancelWithResponseMockTests.java similarity index 58% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateOrCancelWithResponseMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsCreateOrUpdateOrCancelWithResponseMockTests.java index 119559a3c230..1cedaa854d1d 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateOrCancelWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsCreateOrUpdateOrCancelWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; @@ -19,29 +19,29 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ApplyUpdatesCreateOrUpdateOrCancelWithResponseMockTests { +public final class ApplyUpdateOperationGroupsCreateOrUpdateOrCancelWithResponseMockTests { @Test public void testCreateOrUpdateOrCancelWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"RetryNow\",\"resourceId\":\"tmnubexkpzksmon\",\"lastUpdateTime\":\"2021-05-01T02:18:47Z\"},\"id\":\"uxvypomgkopkwh\",\"name\":\"jvp\",\"type\":\"jqg\"}"; + = "{\"properties\":{\"status\":\"Cancel\",\"resourceId\":\"fz\",\"lastUpdateTime\":\"2021-06-21T11:47:26Z\"},\"id\":\"xbuy\",\"name\":\"a\",\"type\":\"zfeqztppri\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ApplyUpdate response = manager.applyUpdates() - .createOrUpdateOrCancelWithResponse("dopcjwvnh", "ld", "mgxcxrslpm", "twuoegrpkhjwni", "qsluicp", - new ApplyUpdateInner().withStatus(UpdateStatus.CANCELLED) - .withResourceId("zl") - .withLastUpdateTime(OffsetDateTime.parse("2021-11-07T19:34:24Z")), + ApplyUpdate response = manager.applyUpdateOperationGroups() + .createOrUpdateOrCancelWithResponse("owpulpq", "lyls", "xkqjnsjervt", "agxsdszuemps", "zkfzbeyv", + new ApplyUpdateInner().withStatus(UpdateStatus.IN_PROGRESS) + .withResourceId("vinvkj") + .withLastUpdateTime(OffsetDateTime.parse("2021-10-15T12:56:31Z")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(UpdateStatus.RETRY_NOW, response.status()); - Assertions.assertEquals("tmnubexkpzksmon", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-01T02:18:47Z"), response.lastUpdateTime()); + Assertions.assertEquals(UpdateStatus.CANCEL, response.status()); + Assertions.assertEquals("fz", response.resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T11:47:26Z"), response.lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateParentWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsGetWithResponseMockTests.java similarity index 60% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateParentWithResponseMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsGetWithResponseMockTests.java index 649d789be060..9ea3dd6e1824 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateParentWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; @@ -18,26 +18,26 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ApplyUpdatesCreateOrUpdateParentWithResponseMockTests { +public final class ApplyUpdateOperationGroupsGetWithResponseMockTests { @Test - public void testCreateOrUpdateParentWithResponse() throws Exception { + public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"InProgress\",\"resourceId\":\"ibahwflus\",\"lastUpdateTime\":\"2021-05-27T17:52:09Z\"},\"id\":\"hrkwo\",\"name\":\"yyv\",\"type\":\"qacpiex\"}"; + = "{\"properties\":{\"status\":\"InProgress\",\"resourceId\":\"kooebwnu\",\"lastUpdateTime\":\"2021-05-07T18:52:45Z\"},\"id\":\"msbvdkcrodtjinf\",\"name\":\"jlfltkacjvefkdlf\",\"type\":\"akggkfpag\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ApplyUpdate response = manager.applyUpdates() - .createOrUpdateParentWithResponse("ysmocmbqfqvmkcxo", "apvhelxprgly", "tddckcb", "uejrjxgc", - "qibrhosxsdqrhzoy", "i", com.azure.core.util.Context.NONE) + ApplyUpdate response = manager.applyUpdateOperationGroups() + .getWithResponse("qoaxoruzfgs", "uyfxrxxleptramxj", "zwl", "nwxuqlcvydyp", "tdooaoj", + com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(UpdateStatus.IN_PROGRESS, response.status()); - Assertions.assertEquals("ibahwflus", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-27T17:52:09Z"), response.lastUpdateTime()); + Assertions.assertEquals("kooebwnu", response.resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-07T18:52:45Z"), response.lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsListMockTests.java similarity index 60% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesListMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsListMockTests.java index 38d4289314d2..11d45e706980 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesListMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdateOperationGroupsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; @@ -19,24 +19,25 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ApplyUpdatesListMockTests { +public final class ApplyUpdateOperationGroupsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"status\":\"RetryNow\",\"resourceId\":\"kcdyhbpk\",\"lastUpdateTime\":\"2021-02-04T17:28:33Z\"},\"id\":\"reqnovvqfov\",\"name\":\"jxywsuws\",\"type\":\"rsndsytgadgvra\"}]}"; + = "{\"value\":[{\"properties\":{\"status\":\"Pending\",\"resourceId\":\"jaltolmnc\",\"lastUpdateTime\":\"2021-02-08T05:43:26Z\"},\"id\":\"qwcsdbnwdcfhuc\",\"name\":\"dpfuvg\",\"type\":\"sbjjc\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.applyUpdates().list(com.azure.core.util.Context.NONE); + PagedIterable response + = manager.applyUpdateOperationGroups().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals(UpdateStatus.RETRY_NOW, response.iterator().next().status()); - Assertions.assertEquals("kcdyhbpk", response.iterator().next().resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-04T17:28:33Z"), + Assertions.assertEquals(UpdateStatus.PENDING, response.iterator().next().status()); + Assertions.assertEquals("jaltolmnc", response.iterator().next().resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T05:43:26Z"), response.iterator().next().lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatePropertiesTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatePropertiesTests.java deleted file mode 100644 index 8fb5f43b1f81..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatePropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateProperties; -import com.azure.resourcemanager.maintenance.models.UpdateStatus; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ApplyUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplyUpdateProperties model = BinaryData - .fromString("{\"status\":\"Pending\",\"resourceId\":\"y\",\"lastUpdateTime\":\"2021-05-02T14:53:40Z\"}") - .toObject(ApplyUpdateProperties.class); - Assertions.assertEquals(UpdateStatus.PENDING, model.status()); - Assertions.assertEquals("y", model.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T14:53:40Z"), model.lastUpdateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplyUpdateProperties model = new ApplyUpdateProperties().withStatus(UpdateStatus.PENDING) - .withResourceId("y") - .withLastUpdateTime(OffsetDateTime.parse("2021-05-02T14:53:40Z")); - model = BinaryData.fromObject(model).toObject(ApplyUpdateProperties.class); - Assertions.assertEquals(UpdateStatus.PENDING, model.status()); - Assertions.assertEquals("y", model.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-02T14:53:40Z"), model.lastUpdateTime()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentWithResponseMockTests.java index 45ac0b20807a..8d914fb4fe0c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetParentWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; @@ -22,22 +22,22 @@ public final class ApplyUpdatesGetParentWithResponseMockTests { @Test public void testGetParentWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Pending\",\"resourceId\":\"owwquuvxz\",\"lastUpdateTime\":\"2021-05-22T14:25:48Z\"},\"id\":\"ithhqzon\",\"name\":\"sg\",\"type\":\"b\"}"; + = "{\"properties\":{\"status\":\"NoUpdatesPending\",\"resourceId\":\"ytdw\",\"lastUpdateTime\":\"2021-10-18T23:06:28Z\"},\"id\":\"qu\",\"name\":\"paxh\",\"type\":\"xiilivpdtiirqt\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ApplyUpdate response = manager.applyUpdates() - .getParentWithResponse("ltmuwlauwzizx", "mpgcjefuzmuvpbt", "d", "morppxebmnzbtbh", "pglkf", "ohdneuel", - "phsdyhto", com.azure.core.util.Context.NONE) + .getParentWithResponse("sofwqmzqalkrmnji", "pxacqqudfn", "yxbaaabjyvayf", "imrzrtuzqog", "exn", + "vfdnwnwmewzsyyce", "zsoibjudpfrxtr", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(UpdateStatus.PENDING, response.status()); - Assertions.assertEquals("owwquuvxz", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T14:25:48Z"), response.lastUpdateTime()); + Assertions.assertEquals(UpdateStatus.NO_UPDATES_PENDING, response.status()); + Assertions.assertEquals("ytdw", response.resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-18T23:06:28Z"), response.lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupsCreateOrUpdateParentWithResponseMockTests.java similarity index 52% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetWithResponseMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupsCreateOrUpdateParentWithResponseMockTests.java index c523a0b19d3f..067665baaa3e 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesGetWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupsCreateOrUpdateParentWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; @@ -18,26 +18,26 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ApplyUpdatesGetWithResponseMockTests { +public final class ApplyUpdatesOperationGroupsCreateOrUpdateParentWithResponseMockTests { @Test - public void testGetWithResponse() throws Exception { + public void testCreateOrUpdateParentWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Cancelled\",\"resourceId\":\"ihgwqapnedgfbcv\",\"lastUpdateTime\":\"2021-08-11T14:17:34Z\"},\"id\":\"vpk\",\"name\":\"qdcvdrhvoo\",\"type\":\"sotbob\"}"; + = "{\"properties\":{\"status\":\"RetryLater\",\"resourceId\":\"oqaqhvseufuq\",\"lastUpdateTime\":\"2021-04-20T04:35:27Z\"},\"id\":\"dlcgqlsismjqfr\",\"name\":\"dgamquhiosrsj\",\"type\":\"ivfcdisyirnx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ApplyUpdate response = manager.applyUpdates() - .getWithResponse("c", "hfwdsjnkaljutiis", "acffgdkzzewkfvhq", "railvpnppfuf", "rwdmhdlxyjrxsa", - com.azure.core.util.Context.NONE) + ApplyUpdate response = manager.applyUpdatesOperationGroups() + .createOrUpdateParentWithResponse("ijddtvqc", "tad", "jaeukmrsieekpn", "zaapmudqmeqwi", "pibudqwyxebeybpm", + "znrtffyaqit", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(UpdateStatus.CANCELLED, response.status()); - Assertions.assertEquals("ihgwqapnedgfbcv", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-11T14:17:34Z"), response.lastUpdateTime()); + Assertions.assertEquals(UpdateStatus.RETRY_LATER, response.status()); + Assertions.assertEquals("oqaqhvseufuq", response.resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T04:35:27Z"), response.lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupsCreateOrUpdateWithResponseMockTests.java similarity index 64% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateWithResponseMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupsCreateOrUpdateWithResponseMockTests.java index 7595b159c798..6edcd90ff1c1 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ApplyUpdatesOperationGroupsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ApplyUpdate; @@ -18,26 +18,25 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ApplyUpdatesCreateOrUpdateWithResponseMockTests { +public final class ApplyUpdatesOperationGroupsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"status\":\"Completed\",\"resourceId\":\"byuqerpqlp\",\"lastUpdateTime\":\"2021-10-05T15:21:02Z\"},\"id\":\"iuqgbdbutauv\",\"name\":\"btkuwhh\",\"type\":\"hykojoxafnndlpic\"}"; + = "{\"properties\":{\"status\":\"Completed\",\"resourceId\":\"zlrpiqywncvj\",\"lastUpdateTime\":\"2021-08-02T13:28:26Z\"},\"id\":\"ofizehtdhgbj\",\"name\":\"vreljea\",\"type\":\"urvzmlovuanashc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ApplyUpdate response = manager.applyUpdates() - .createOrUpdateWithResponse("btgiwbwoenwas", "rtdtkcnqxw", "p", "kulpiujwaasi", - com.azure.core.util.Context.NONE) + ApplyUpdate response = manager.applyUpdatesOperationGroups() + .createOrUpdateWithResponse("hcz", "xrxzbujrtr", "qvwre", "khgn", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(UpdateStatus.COMPLETED, response.status()); - Assertions.assertEquals("byuqerpqlp", response.resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-05T15:21:02Z"), response.lastUpdateTime()); + Assertions.assertEquals("zlrpiqywncvj", response.resourceId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-02T13:28:26Z"), response.lastUpdateTime()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentFilterPropertiesTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentFilterPropertiesTests.java deleted file mode 100644 index 459b7e0c458d..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentFilterPropertiesTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationAssignmentFilterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationAssignmentFilterProperties model = BinaryData.fromString( - "{\"resourceTypes\":[\"uynhijg\",\"mebf\",\"iarbutrcvpna\"],\"resourceGroups\":[\"hj\",\"unmpxttd\",\"hrbnlankxmyskpbh\",\"nbtkcxywnytnr\"],\"osTypes\":[\"lqidyby\",\"czfc\",\"haaxdbabphl\"],\"locations\":[\"lfktsths\",\"cocmnyyaztt\",\"twwrqp\"],\"tagSettings\":{\"tags\":{\"eaxib\":[\"zywbiex\",\"fey\"],\"oxaepd\":[\"jwbhqwalmuz\"],\"jswztsdbpg\":[\"jancu\",\"rhdwbavxbniw\"],\"ovplw\":[\"ytxhp\",\"xbzpfzab\",\"lcuhxwtctyqiklb\"]},\"filterOperator\":\"Any\"}}") - .toObject(ConfigurationAssignmentFilterProperties.class); - Assertions.assertEquals("uynhijg", model.resourceTypes().get(0)); - Assertions.assertEquals("hj", model.resourceGroups().get(0)); - Assertions.assertEquals("lqidyby", model.osTypes().get(0)); - Assertions.assertEquals("lfktsths", model.locations().get(0)); - Assertions.assertEquals("zywbiex", model.tagSettings().tags().get("eaxib").get(0)); - Assertions.assertEquals(TagOperators.ANY, model.tagSettings().filterOperator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationAssignmentFilterProperties model = new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("uynhijg", "mebf", "iarbutrcvpna")) - .withResourceGroups(Arrays.asList("hj", "unmpxttd", "hrbnlankxmyskpbh", "nbtkcxywnytnr")) - .withOsTypes(Arrays.asList("lqidyby", "czfc", "haaxdbabphl")) - .withLocations(Arrays.asList("lfktsths", "cocmnyyaztt", "twwrqp")) - .withTagSettings(new TagSettingsProperties().withTags(mapOf("eaxib", Arrays.asList("zywbiex", "fey"), - "oxaepd", Arrays.asList("jwbhqwalmuz"), "jswztsdbpg", Arrays.asList("jancu", "rhdwbavxbniw"), "ovplw", - Arrays.asList("ytxhp", "xbzpfzab", "lcuhxwtctyqiklb"))).withFilterOperator(TagOperators.ANY)); - model = BinaryData.fromObject(model).toObject(ConfigurationAssignmentFilterProperties.class); - Assertions.assertEquals("uynhijg", model.resourceTypes().get(0)); - Assertions.assertEquals("hj", model.resourceGroups().get(0)); - Assertions.assertEquals("lqidyby", model.osTypes().get(0)); - Assertions.assertEquals("lfktsths", model.locations().get(0)); - Assertions.assertEquals("zywbiex", model.tagSettings().tags().get("eaxib").get(0)); - Assertions.assertEquals(TagOperators.ANY, model.tagSettings().filterOperator()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentForResourceGroupOperationGroupsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentForResourceGroupOperationGroupsListMockTests.java new file mode 100644 index 000000000000..31dc82908c51 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentForResourceGroupOperationGroupsListMockTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConfigurationAssignmentForResourceGroupOperationGroupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"location\":\"fovvacqpbtuodxes\",\"properties\":{\"maintenanceConfigurationId\":\"belawumuaslzkwr\",\"resourceId\":\"oycqucwy\",\"filter\":{\"resourceTypes\":[\"omd\",\"kywuhpsvfuu\",\"utlwexxwla\",\"niexzsrzpgepq\"],\"resourceGroups\":[\"bwwpgdakchzy\"],\"osTypes\":[\"xqnrkcxk\",\"ibn\",\"mysu\",\"swqrntvlwijp\"],\"locations\":[\"exoqqpwcyyufm\",\"runcuwmqspkcd\",\"zhlctddunqndyfpc\"],\"tagSettings\":{\"tags\":{\"rjtloq\":[\"jjrcgegydc\",\"boxjumvq\",\"olihrra\",\"ouau\"]},\"filterOperator\":\"Any\"}}},\"id\":\"jrngif\",\"name\":\"rzpasccbiuimzdly\",\"type\":\"dfqwmkyoq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.configurationAssignmentForResourceGroupOperationGroups() + .list("zhmkdasvflyh", "xcudchxgsr", "oldforobw", "lvizb", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fovvacqpbtuodxes", response.iterator().next().location()); + Assertions.assertEquals("belawumuaslzkwr", response.iterator().next().maintenanceConfigurationId()); + Assertions.assertEquals("oycqucwy", response.iterator().next().resourceId()); + Assertions.assertEquals("omd", response.iterator().next().filter().resourceTypes().get(0)); + Assertions.assertEquals("bwwpgdakchzy", response.iterator().next().filter().resourceGroups().get(0)); + Assertions.assertEquals("xqnrkcxk", response.iterator().next().filter().osTypes().get(0)); + Assertions.assertEquals("exoqqpwcyyufm", response.iterator().next().filter().locations().get(0)); + Assertions.assertEquals("jjrcgegydc", + response.iterator().next().filter().tagSettings().tags().get("rjtloq").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.iterator().next().filter().tagSettings().filterOperator()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentInnerTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentInnerTests.java deleted file mode 100644 index e90bd0d5234e..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentInnerTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationAssignmentInner model = BinaryData.fromString( - "{\"location\":\"e\",\"properties\":{\"maintenanceConfigurationId\":\"onpc\",\"resourceId\":\"ocohslkevleg\",\"filter\":{\"resourceTypes\":[\"u\",\"fmvfaxkffeiit\",\"lvmezyvshxmzsbbz\",\"ggi\"],\"resourceGroups\":[\"wburvjxxjnspydpt\",\"oenkouknvudwti\",\"kbldngkpocipa\"],\"osTypes\":[\"o\",\"gukgjnpiucgygevq\",\"ntypmrbpizcdrqj\",\"dpydn\"],\"locations\":[\"xdeoejzic\",\"ifsjttgzfbishcb\"],\"tagSettings\":{\"tags\":{\"kix\":[\"eyeam\",\"p\",\"agalpbuxwgipwhon\",\"wkgshwa\"],\"ttmrywnuzoqf\":[\"injep\"],\"oqqnwvlryav\":[\"yqzrnkcqvyxlw\",\"zlsico\"]},\"filterOperator\":\"All\"}}},\"id\":\"unmmq\",\"name\":\"gyxzk\",\"type\":\"noc\"}") - .toObject(ConfigurationAssignmentInner.class); - Assertions.assertEquals("e", model.location()); - Assertions.assertEquals("onpc", model.maintenanceConfigurationId()); - Assertions.assertEquals("ocohslkevleg", model.resourceId()); - Assertions.assertEquals("u", model.filter().resourceTypes().get(0)); - Assertions.assertEquals("wburvjxxjnspydpt", model.filter().resourceGroups().get(0)); - Assertions.assertEquals("o", model.filter().osTypes().get(0)); - Assertions.assertEquals("xdeoejzic", model.filter().locations().get(0)); - Assertions.assertEquals("eyeam", model.filter().tagSettings().tags().get("kix").get(0)); - Assertions.assertEquals(TagOperators.ALL, model.filter().tagSettings().filterOperator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationAssignmentInner model = new ConfigurationAssignmentInner().withLocation("e") - .withMaintenanceConfigurationId("onpc") - .withResourceId("ocohslkevleg") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("u", "fmvfaxkffeiit", "lvmezyvshxmzsbbz", "ggi")) - .withResourceGroups(Arrays.asList("wburvjxxjnspydpt", "oenkouknvudwti", "kbldngkpocipa")) - .withOsTypes(Arrays.asList("o", "gukgjnpiucgygevq", "ntypmrbpizcdrqj", "dpydn")) - .withLocations(Arrays.asList("xdeoejzic", "ifsjttgzfbishcb")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("kix", Arrays.asList("eyeam", "p", "agalpbuxwgipwhon", "wkgshwa"), "ttmrywnuzoqf", - Arrays.asList("injep"), "oqqnwvlryav", Arrays.asList("yqzrnkcqvyxlw", "zlsico"))) - .withFilterOperator(TagOperators.ALL))); - model = BinaryData.fromObject(model).toObject(ConfigurationAssignmentInner.class); - Assertions.assertEquals("e", model.location()); - Assertions.assertEquals("onpc", model.maintenanceConfigurationId()); - Assertions.assertEquals("ocohslkevleg", model.resourceId()); - Assertions.assertEquals("u", model.filter().resourceTypes().get(0)); - Assertions.assertEquals("wburvjxxjnspydpt", model.filter().resourceGroups().get(0)); - Assertions.assertEquals("o", model.filter().osTypes().get(0)); - Assertions.assertEquals("xdeoejzic", model.filter().locations().get(0)); - Assertions.assertEquals("eyeam", model.filter().tagSettings().tags().get("kix").get(0)); - Assertions.assertEquals(TagOperators.ALL, model.filter().tagSettings().filterOperator()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..c2b4675f2e53 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConfigurationAssignmentOperationGroupsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"location\":\"rsre\",\"properties\":{\"maintenanceConfigurationId\":\"xurisjnhnyt\",\"resourceId\":\"fq\",\"filter\":{\"resourceTypes\":[\"mrhublwpc\",\"sutrgjup\"],\"resourceGroups\":[\"tpwoqhihejq\",\"w\",\"pnfqntcyp\",\"xjvfoimwksl\"],\"osTypes\":[\"izjx\",\"ydfce\",\"cvlhv\",\"gdyftumrtwna\"],\"locations\":[\"lbiw\"],\"tagSettings\":{\"tags\":{\"bydvkhbejdz\":[\"yztsfmz\",\"baeqphc\",\"qnrnrpxehuwryk\",\"gaifmvik\"],\"volvtn\":[\"cvdsrhnj\"],\"ltducea\":[\"qfzgemjdftul\"],\"jpr\":[\"mczuo\",\"ejwcwwqiok\",\"ssxmojms\",\"p\"]},\"filterOperator\":\"Any\"}}},\"id\":\"fz\",\"name\":\"ljyxgtczhe\",\"type\":\"dbsdshm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ConfigurationAssignment response + = manager.configurationAssignmentOperationGroups() + .createOrUpdateWithResponse("rgnepttwqmsniffc", "mqnrojlpijnkr", "frddhcrati", "zronasxift", "zq", + new ConfigurationAssignmentInner().withLocation("hftwesgog") + .withMaintenanceConfigurationId("onnxkrlgnyhm") + .withResourceId("sxkkg") + .withFilter(new ConfigurationAssignmentFilterProperties() + .withResourceTypes(Arrays.asList("gh", "jbdhqxvc")) + .withResourceGroups(Arrays.asList("rpdsof", "shrnsvbuswdvz", "ybycnunvj", "rtkfawnopq")) + .withOsTypes(Arrays.asList("yzirtxdyuxzejn", "psew", "ioilqukrydxtq")) + .withLocations(Arrays.asList("ox", "rgguf", "yaomtb", "hhavgrvkffovjz")) + .withTagSettings(new TagSettingsProperties().withTags(mapOf("zbomvzzbtdcqvpni", + Arrays.asList("bgj", "fxumv", "cluyovwxnbkf", "zzxscyhwzdgiruj"), "rymsgaojfmw", + Arrays.asList("jviylwdshfs", "n", "bgye"), "piwyczuhxacpqjl", + Arrays.asList("otmrfhir", "tymoxoftp"))).withFilterOperator(TagOperators.ALL))), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("rsre", response.location()); + Assertions.assertEquals("xurisjnhnyt", response.maintenanceConfigurationId()); + Assertions.assertEquals("fq", response.resourceId()); + Assertions.assertEquals("mrhublwpc", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("tpwoqhihejq", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("izjx", response.filter().osTypes().get(0)); + Assertions.assertEquals("lbiw", response.filter().locations().get(0)); + Assertions.assertEquals("yztsfmz", response.filter().tagSettings().tags().get("bydvkhbejdz").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsDeleteWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..06a7d8c6694f --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsDeleteWithResponseMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConfigurationAssignmentOperationGroupsDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr + = "{\"location\":\"pyklyhpluodpvru\",\"properties\":{\"maintenanceConfigurationId\":\"gzibthostgktstv\",\"resourceId\":\"eclze\",\"filter\":{\"resourceTypes\":[\"vh\",\"lhpl\"],\"resourceGroups\":[\"kdl\",\"wqfbumlkxtrqjfsm\"],\"osTypes\":[\"txhwgfws\"],\"locations\":[\"wcoezbrhub\"],\"tagSettings\":{\"tags\":{\"okkqfqjbvleo\":[\"ygo\"],\"cbhernntiewdj\":[\"ml\",\"iqtqzfavyvnq\",\"ybar\",\"euayjkqabqgzsles\"]},\"filterOperator\":\"Any\"}}},\"id\":\"uwrbehwagoh\",\"name\":\"uffkmrqemvvh\",\"type\":\"xtdr\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ConfigurationAssignment response = manager.configurationAssignmentOperationGroups() + .deleteWithResponse("xmaehvbbxu", "iplt", "n", "tbaxk", "xywr", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("pyklyhpluodpvru", response.location()); + Assertions.assertEquals("gzibthostgktstv", response.maintenanceConfigurationId()); + Assertions.assertEquals("eclze", response.resourceId()); + Assertions.assertEquals("vh", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("kdl", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("txhwgfws", response.filter().osTypes().get(0)); + Assertions.assertEquals("wcoezbrhub", response.filter().locations().get(0)); + Assertions.assertEquals("ygo", response.filter().tagSettings().tags().get("okkqfqjbvleo").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsGetWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsGetWithResponseMockTests.java new file mode 100644 index 000000000000..cbbc0919336f --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentOperationGroupsGetWithResponseMockTests.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.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConfigurationAssignmentOperationGroupsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"location\":\"mmji\",\"properties\":{\"maintenanceConfigurationId\":\"ozphvwauyqncygu\",\"resourceId\":\"vipmdscwxqupevzh\",\"filter\":{\"resourceTypes\":[\"txhojujb\",\"pelmcuvhixbjxyf\",\"n\"],\"resourceGroups\":[\"coolsttpkiwkkb\"],\"osTypes\":[\"rywvtylbfpn\",\"urdoi\",\"iithtywu\",\"xcbihw\"],\"locations\":[\"fdntwjchrdgoih\"],\"tagSettings\":{\"tags\":{\"uu\":[\"ton\",\"zj\"]},\"filterOperator\":\"Any\"}}},\"id\":\"wggytsbwtovvt\",\"name\":\"seinqfiuf\",\"type\":\"qknp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ConfigurationAssignment response = manager.configurationAssignmentOperationGroups() + .getWithResponse("wuenvr", "pyouaibrebqaays", "kixqtnqtt", "zlwfffiakp", "pqqmted", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mmji", response.location()); + Assertions.assertEquals("ozphvwauyqncygu", response.maintenanceConfigurationId()); + Assertions.assertEquals("vipmdscwxqupevzh", response.resourceId()); + Assertions.assertEquals("txhojujb", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("coolsttpkiwkkb", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("rywvtylbfpn", response.filter().osTypes().get(0)); + Assertions.assertEquals("fdntwjchrdgoih", response.filter().locations().get(0)); + Assertions.assertEquals("ton", response.filter().tagSettings().tags().get("uu").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentPropertiesTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentPropertiesTests.java deleted file mode 100644 index d420a9a0b403..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentPropertiesTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentProperties; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationAssignmentProperties model = BinaryData.fromString( - "{\"maintenanceConfigurationId\":\"oklyaxuconuq\",\"resourceId\":\"fkbey\",\"filter\":{\"resourceTypes\":[\"mjmwvvjektcx\",\"enhwlrs\",\"frzpwvlqdqgb\"],\"resourceGroups\":[\"lihkaetcktvfc\",\"vf\",\"nkymuctqhjfbebrj\"],\"osTypes\":[\"rfuwutt\",\"xfvjrbirp\",\"xepcyvahfn\"],\"locations\":[\"yq\",\"j\",\"uujqgidokgjljyo\",\"gvcl\"],\"tagSettings\":{\"tags\":{\"htxfvgxbfsmxnehm\":[\"c\",\"hkjeszzhbi\"],\"ispnqzahmgkbrp\":[\"ec\",\"godebfqkkrbmpu\",\"gr\",\"wflzlfbxzpuzy\"],\"kpikadrgvt\":[\"dhibnuq\"]},\"filterOperator\":\"All\"}}}") - .toObject(ConfigurationAssignmentProperties.class); - Assertions.assertEquals("oklyaxuconuq", model.maintenanceConfigurationId()); - Assertions.assertEquals("fkbey", model.resourceId()); - Assertions.assertEquals("mjmwvvjektcx", model.filter().resourceTypes().get(0)); - Assertions.assertEquals("lihkaetcktvfc", model.filter().resourceGroups().get(0)); - Assertions.assertEquals("rfuwutt", model.filter().osTypes().get(0)); - Assertions.assertEquals("yq", model.filter().locations().get(0)); - Assertions.assertEquals("c", model.filter().tagSettings().tags().get("htxfvgxbfsmxnehm").get(0)); - Assertions.assertEquals(TagOperators.ALL, model.filter().tagSettings().filterOperator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationAssignmentProperties model - = new ConfigurationAssignmentProperties().withMaintenanceConfigurationId("oklyaxuconuq") - .withResourceId("fkbey") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("mjmwvvjektcx", "enhwlrs", "frzpwvlqdqgb")) - .withResourceGroups(Arrays.asList("lihkaetcktvfc", "vf", "nkymuctqhjfbebrj")) - .withOsTypes(Arrays.asList("rfuwutt", "xfvjrbirp", "xepcyvahfn")) - .withLocations(Arrays.asList("yq", "j", "uujqgidokgjljyo", "gvcl")) - .withTagSettings( - new TagSettingsProperties().withTags(mapOf("htxfvgxbfsmxnehm", Arrays.asList("c", "hkjeszzhbi"), - "ispnqzahmgkbrp", Arrays.asList("ec", "godebfqkkrbmpu", "gr", "wflzlfbxzpuzy"), - "kpikadrgvt", Arrays.asList("dhibnuq"))).withFilterOperator(TagOperators.ALL))); - model = BinaryData.fromObject(model).toObject(ConfigurationAssignmentProperties.class); - Assertions.assertEquals("oklyaxuconuq", model.maintenanceConfigurationId()); - Assertions.assertEquals("fkbey", model.resourceId()); - Assertions.assertEquals("mjmwvvjektcx", model.filter().resourceTypes().get(0)); - Assertions.assertEquals("lihkaetcktvfc", model.filter().resourceGroups().get(0)); - Assertions.assertEquals("rfuwutt", model.filter().osTypes().get(0)); - Assertions.assertEquals("yq", model.filter().locations().get(0)); - Assertions.assertEquals("c", model.filter().tagSettings().tags().get("htxfvgxbfsmxnehm").get(0)); - Assertions.assertEquals(TagOperators.ALL, model.filter().tagSettings().filterOperator()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentWithResponseMockTests.java index 14c73447d349..18e3da5f1fa9 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateParentWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; @@ -28,40 +28,42 @@ public final class ConfigurationAssignmentsCreateOrUpdateParentWithResponseMockT @Test public void testCreateOrUpdateParentWithResponse() throws Exception { String responseStr - = "{\"location\":\"rxcyjmoad\",\"properties\":{\"maintenanceConfigurationId\":\"arm\",\"resourceId\":\"dmjsjqb\",\"filter\":{\"resourceTypes\":[\"x\",\"rw\",\"yc\"],\"resourceGroups\":[\"hp\",\"xkgymareqnajxqu\",\"jhkycub\"],\"osTypes\":[\"gssofwq\",\"zqalkrmnjijpx\",\"cqqudf\",\"byxbaaabjy\"],\"locations\":[\"ffimrzrtuzqogsex\",\"evfdnwnwm\",\"wzsyyceuzs\",\"i\"],\"tagSettings\":{\"tags\":{\"r\":[\"frxtrthzvaytdwk\",\"brqubp\",\"xhexiilivpdti\"],\"lwnwxuqlcvydyp\":[\"d\",\"oaxoruzfgsqu\",\"fxrxxle\",\"tramxjez\"],\"msbvdkcrodtjinf\":[\"dooaojkniodko\",\"ebwnujhe\"],\"xsdszuempsb\":[\"lfltka\",\"jvefkdlfoakggkfp\",\"gaowpulpqblylsyx\",\"qjnsjervtia\"]},\"filterOperator\":\"All\"}}},\"id\":\"beyvpnqicvinvkjj\",\"name\":\"dxrbuukzcle\",\"type\":\"yhmlwpaztzp\"}"; + = "{\"location\":\"krefajpjo\",\"properties\":{\"maintenanceConfigurationId\":\"qnyhgb\",\"resourceId\":\"tjivfxzsjabib\",\"filter\":{\"resourceTypes\":[\"awfsdjpvkvpbjxbk\",\"bzkdvn\",\"jabudurgkakmo\"],\"resourceGroups\":[\"jjklff\",\"mouwqlgzrfzeey\"],\"osTypes\":[\"zi\",\"ayuhqlbjbsy\",\"bqwrvtldgm\"],\"locations\":[\"vm\",\"ipaslthaqfxssmwu\",\"wbdsr\",\"zpdrhneu\"],\"tagSettings\":{\"tags\":{\"ytisibir\":[\"d\"]},\"filterOperator\":\"All\"}}},\"id\":\"kpzi\",\"name\":\"ejzanlfz\",\"type\":\"iavrm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignments() - .createOrUpdateParentWithResponse("cjzkzivgvvcna", "rhyrnxxmueed", "drd", "stkwqqtch", "alm", "mtdaa", - "gdv", - new ConfigurationAssignmentInner().withLocation("gpiohgwxrtfudxe") - .withMaintenanceConfigurationId("yqagvrvm") - .withResourceId("k") + .createOrUpdateParentWithResponse("grtwae", "u", "zkopb", "inrfdwoyu", "hziuiefozbhdms", "l", "zqhof", + new ConfigurationAssignmentInner().withLocation("maequiahxicslfa") + .withMaintenanceConfigurationId("piyylhalnswhccsp") + .withResourceId("aivwitqscywu") .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("i", "dblx")) - .withResourceGroups(Arrays.asList("mfnjh", "j", "wmszkk")) - .withOsTypes(Arrays.asList("rey", "kzikfjawneaivxwc")) - .withLocations(Arrays.asList("pcirelsfeaen", "abfatkl", "dxbjhwuaanozj")) - .withTagSettings(new TagSettingsProperties().withTags(mapOf("rvimjwosytxitcsk", - Arrays.asList("oulpjrv", "ag"), "yf", Arrays.asList("k", "qumiek", "ez", "ikh"))) - .withFilterOperator(TagOperators.ANY))), + .withResourceTypes(Arrays.asList("luhczbw", "mhairsbrgzdwmsw", "ypqwdxggiccc")) + .withResourceGroups(Arrays.asList("huexmk", "tlstvlzywem")) + .withOsTypes(Arrays.asList("ncsdtclusiyp", "sfgytguslfead", "ygqukyhejh")) + .withLocations(Arrays.asList("xgfpelolppv")) + .withTagSettings(new TagSettingsProperties() + .withTags(mapOf("cdl", Arrays.asList("vu", "zraehtwd", "r", "tswiby"), "hevxcced", + Arrays.asList("shfwpracstwity"), "y", + Arrays.asList("nmdyodnwzxl", "jc", "nhltiugcxn", "vvwxqi"), "j", + Arrays.asList("nyowxwlmdjrkvfg", "vfvpdbodaciz"))) + .withFilterOperator(TagOperators.ALL))), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rxcyjmoad", response.location()); - Assertions.assertEquals("arm", response.maintenanceConfigurationId()); - Assertions.assertEquals("dmjsjqb", response.resourceId()); - Assertions.assertEquals("x", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("hp", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("gssofwq", response.filter().osTypes().get(0)); - Assertions.assertEquals("ffimrzrtuzqogsex", response.filter().locations().get(0)); - Assertions.assertEquals("frxtrthzvaytdwk", response.filter().tagSettings().tags().get("r").get(0)); + Assertions.assertEquals("krefajpjo", response.location()); + Assertions.assertEquals("qnyhgb", response.maintenanceConfigurationId()); + Assertions.assertEquals("tjivfxzsjabib", response.resourceId()); + Assertions.assertEquals("awfsdjpvkvpbjxbk", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("jjklff", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("zi", response.filter().osTypes().get(0)); + Assertions.assertEquals("vm", response.filter().locations().get(0)); + Assertions.assertEquals("d", response.filter().tagSettings().tags().get("ytisibir").get(0)); Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index d76a80c1d46a..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationAssignmentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"location\":\"ij\",\"properties\":{\"maintenanceConfigurationId\":\"vfxzsjab\",\"resourceId\":\"systawfsdjp\",\"filter\":{\"resourceTypes\":[\"bjxbkzbzk\"],\"resourceGroups\":[\"cjabudurgkakmo\"],\"osTypes\":[\"jjklff\",\"mouwqlgzrfzeey\"],\"locations\":[\"zi\",\"ayuhqlbjbsy\",\"bqwrvtldgm\"],\"tagSettings\":{\"tags\":{\"hneuyowqkd\":[\"pip\",\"slthaq\",\"x\",\"smwutwbdsrezpd\"]},\"filterOperator\":\"All\"}}},\"id\":\"sibircgpi\",\"name\":\"pzimejzanlfzxi\",\"type\":\"vrmbzono\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationAssignment response - = manager.configurationAssignments() - .createOrUpdateWithResponse("bwemhairs", "rgzdwmsweyp", "w", "xggicccnxqhuexmk", "tlstvlzywem", - new ConfigurationAssignmentInner().withLocation("rncsdtclu") - .withMaintenanceConfigurationId("pbsfgytgu") - .withResourceId("feadcygq") - .withFilter( - new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("ejhzisxg", "pelol")) - .withResourceGroups(Arrays.asList("ksrpqv")) - .withOsTypes(Arrays.asList("raehtwdwrft", "wib")) - .withLocations(Arrays.asList("dl")) - .withTagSettings( - new TagSettingsProperties() - .withTags(mapOf("jc", Arrays.asList("wpracstwitykhev", "c", "edcpnmdyodnwzxl"), - "wlmdjrkv", Arrays.asList("hlt", "ugcxnavvwxq", "byqunyow"), - "cizsjqlhkrribdei", Arrays.asList("bvfvpdbod"))) - .withFilterOperator(TagOperators.ANY))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ij", response.location()); - Assertions.assertEquals("vfxzsjab", response.maintenanceConfigurationId()); - Assertions.assertEquals("systawfsdjp", response.resourceId()); - Assertions.assertEquals("bjxbkzbzk", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("cjabudurgkakmo", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("jjklff", response.filter().osTypes().get(0)); - Assertions.assertEquals("zi", response.filter().locations().get(0)); - Assertions.assertEquals("pip", response.filter().tagSettings().tags().get("hneuyowqkd").get(0)); - Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentWithResponseMockTests.java index adaabe5c7fe4..0e1c0d36cb50 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteParentWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -22,28 +22,28 @@ public final class ConfigurationAssignmentsDeleteParentWithResponseMockTests { @Test public void testDeleteParentWithResponse() throws Exception { String responseStr - = "{\"location\":\"cwsobqwcs\",\"properties\":{\"maintenanceConfigurationId\":\"wdcfhucqdpfuv\",\"resourceId\":\"sbjjc\",\"filter\":{\"resourceTypes\":[\"bvtvudutncormr\",\"xqtvcofu\"],\"resourceGroups\":[\"vkg\",\"u\"],\"osTypes\":[\"knnqvsaznq\",\"tor\",\"dsg\"],\"locations\":[\"mkycgra\"],\"tagSettings\":{\"tags\":{\"q\":[\"taeburuvdm\",\"vsmzlxwab\"],\"gkfbtndoaong\":[\"fkifr\",\"tpuqujmq\"]},\"filterOperator\":\"All\"}}},\"id\":\"tujitcjedft\",\"name\":\"waezkojvd\",\"type\":\"pzfoqoui\"}"; + = "{\"location\":\"hszfjvfb\",\"properties\":{\"maintenanceConfigurationId\":\"eljag\",\"resourceId\":\"mqhldvrii\",\"filter\":{\"resourceTypes\":[\"al\",\"hfkvtvsexsowuel\",\"qhhahhxvrhmzkwpj\",\"wws\"],\"resourceGroups\":[\"hftqsxhqxujxukn\",\"xdigrjg\",\"ufzdmsyq\",\"fi\"],\"osTypes\":[\"botzingamvppho\",\"zqzudph\",\"amvdkfwynwcvtbv\",\"ayhmtnvyqiatkz\"],\"locations\":[\"npwzcjaes\",\"vvsccyajguq\",\"hwyg\",\"lvdnkfx\"],\"tagSettings\":{\"tags\":{\"qxqvpsvuoymgc\":[\"wzrmuh\",\"pfcqdp\"],\"erqwkyhkobopg\":[\"lvez\",\"ypql\",\"feo\"],\"fq\":[\"dkow\",\"pbqpcrfkbwccsn\",\"vcdwxlpqekftn\",\"htjsying\"],\"birryuzhl\":[\"mtdh\",\"mdvy\",\"gikdgsz\",\"w\"]},\"filterOperator\":\"Any\"}}},\"id\":\"qrvqq\",\"name\":\"atjinrvgoupmfiib\",\"type\":\"ggjioolvr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignments() - .deleteParentWithResponse("fn", "ckw", "fz", "whxxbuyqax", "feqztppriol", "or", "altol", + .deleteParentWithResponse("zonokixrjqci", "gzpfrla", "szrnwo", "indfpwpjyl", "bt", "h", "lsj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("cwsobqwcs", response.location()); - Assertions.assertEquals("wdcfhucqdpfuv", response.maintenanceConfigurationId()); - Assertions.assertEquals("sbjjc", response.resourceId()); - Assertions.assertEquals("bvtvudutncormr", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("vkg", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("knnqvsaznq", response.filter().osTypes().get(0)); - Assertions.assertEquals("mkycgra", response.filter().locations().get(0)); - Assertions.assertEquals("taeburuvdm", response.filter().tagSettings().tags().get("q").get(0)); - Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); + Assertions.assertEquals("hszfjvfb", response.location()); + Assertions.assertEquals("eljag", response.maintenanceConfigurationId()); + Assertions.assertEquals("mqhldvrii", response.resourceId()); + Assertions.assertEquals("al", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("hftqsxhqxujxukn", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("botzingamvppho", response.filter().osTypes().get(0)); + Assertions.assertEquals("npwzcjaes", response.filter().locations().get(0)); + Assertions.assertEquals("wzrmuh", response.filter().tagSettings().tags().get("qxqvpsvuoymgc").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteWithResponseMockTests.java deleted file mode 100644 index db7916cf0c5a..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationAssignmentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr - = "{\"location\":\"ylwbtlhflsjcdhsz\",\"properties\":{\"maintenanceConfigurationId\":\"fbgofeljagrqmqh\",\"resourceId\":\"vriiio\",\"filter\":{\"resourceTypes\":[\"ghfkvtvsexs\"],\"resourceGroups\":[\"el\",\"qhhahhxvrhmzkwpj\",\"wws\",\"ughftqsx\"],\"osTypes\":[\"ujxukndxd\",\"grjguufzd\"],\"locations\":[\"qtfihwhbotzinga\",\"vppho\"],\"tagSettings\":{\"tags\":{\"npwzcjaes\":[\"dphqamv\",\"kfwynw\",\"vtbvkayh\",\"tnvyqiatkzwp\"],\"lvdnkfx\":[\"v\",\"ccyajg\",\"qfhwyg\"],\"vezrypqlmfeo\":[\"emdwzrmuhapfc\",\"dpsqx\",\"vpsvuoymgcce\"],\"kftnkhtjsyin\":[\"rqwky\",\"kobopgxed\",\"owepbqpcrfkb\",\"ccsnjvcdwxlpq\"]},\"filterOperator\":\"All\"}}},\"id\":\"atmtdhtmdvy\",\"name\":\"gikdgsz\",\"type\":\"w\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationAssignment response = manager.configurationAssignments() - .deleteWithResponse("i", "rjqc", "rgz", "frl", "zszrnwoiindfpw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ylwbtlhflsjcdhsz", response.location()); - Assertions.assertEquals("fbgofeljagrqmqh", response.maintenanceConfigurationId()); - Assertions.assertEquals("vriiio", response.resourceId()); - Assertions.assertEquals("ghfkvtvsexs", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("el", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("ujxukndxd", response.filter().osTypes().get(0)); - Assertions.assertEquals("qtfihwhbotzinga", response.filter().locations().get(0)); - Assertions.assertEquals("dphqamv", response.filter().tagSettings().tags().get("npwzcjaes").get(0)); - Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsCreateOrUpdateWithResponseMockTests.java index e6be00f1d9c6..bd6cc78476dc 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; @@ -28,43 +28,38 @@ public final class ConfigurationAssignmentsForResourceGroupsCreateOrUpdateWithRe @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"location\":\"zbfhfovvac\",\"properties\":{\"maintenanceConfigurationId\":\"tuodxeszabbelaw\",\"resourceId\":\"ua\",\"filter\":{\"resourceTypes\":[\"wrrwoycqucw\",\"hahnomdrkywuhps\"],\"resourceGroups\":[\"urut\",\"we\",\"xwlalniexzsrzpg\",\"pqtybb\"],\"osTypes\":[\"gdakchz\",\"vl\",\"xqnrkcxk\"],\"locations\":[\"nxm\"],\"tagSettings\":{\"tags\":{\"uncuw\":[\"wq\",\"ntvlwijpsttexo\",\"qpwcyyufmh\"]},\"filterOperator\":\"All\"}}},\"id\":\"kcdqzhlct\",\"name\":\"dunqnd\",\"type\":\"fpch\"}"; + = "{\"location\":\"dtutnwldu\",\"properties\":{\"maintenanceConfigurationId\":\"uzhyrmewipmvekdx\",\"resourceId\":\"uqgsj\",\"filter\":{\"resourceTypes\":[\"dxgketwzhhzjhfj\"],\"resourceGroups\":[\"vmuvgpmu\"],\"osTypes\":[\"sx\",\"mhfbuzjy\"],\"locations\":[\"as\",\"hudypohyuemsl\"],\"tagSettings\":{\"tags\":{\"fhqlyvi\":[\"rpfoobr\",\"ttymsjny\",\"qdnfwqzdz\",\"tilaxh\"]},\"filterOperator\":\"All\"}}},\"id\":\"iv\",\"name\":\"xoyzunbix\",\"type\":\"rtikvcpwpg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ConfigurationAssignment response - = manager.configurationAssignmentsForResourceGroups() - .createOrUpdateWithResponse("jaeukmrsieekpn", "zaapmudqmeqwi", - new ConfigurationAssignmentInner().withLocation("ibudqwy") - .withMaintenanceConfigurationId("e") - .withResourceId("pmzznrtffya") - .withFilter( - new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("hheioqaqhvseuf")) - .withResourceGroups(Arrays.asList("rxpdlcgqlsi", "mjqfrddgamquhio", "rsjuivfcdisyir")) - .withOsTypes(Arrays.asList("hcz", "xrxzbujrtr", "qvwre", "khgn")) - .withLocations(Arrays.asList("onzlr", "i", "yw", "cvjtszcofiz")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("erbdk", Arrays.asList("gbjkvreljeamur", "zmlovuanash", "xlpm"), - "nkeifz", Arrays.asList("vidizozsdb", "cxjmonfdgnwncyp", "uwwltvuqjctz"), - "chxgs", Arrays.asList("mkdasv", "lyhb", "cu"))) - .withFilterOperator(TagOperators.ANY))), - com.azure.core.util.Context.NONE) - .getValue(); + ConfigurationAssignment response = manager.configurationAssignmentsForResourceGroups() + .createOrUpdateWithResponse("thwwn", "jhlfzswpchwahf", + new ConfigurationAssignmentInner().withLocation("usnfepgfewet") + .withMaintenanceConfigurationId("xgncxyk") + .withResourceId("djhlimm") + .withFilter(new ConfigurationAssignmentFilterProperties().withResourceTypes(Arrays.asList("h")) + .withResourceGroups(Arrays.asList("orxvxcjzhqiz")) + .withOsTypes(Arrays.asList("xtgqscjavftjuh", "qaz", "mtggu")) + .withLocations(Arrays.asList("jrajcivm")) + .withTagSettings( + new TagSettingsProperties().withTags(mapOf("uvyinzqodfvpgs", Arrays.asList("fiwrxgkn"))) + .withFilterOperator(TagOperators.ALL))), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("zbfhfovvac", response.location()); - Assertions.assertEquals("tuodxeszabbelaw", response.maintenanceConfigurationId()); - Assertions.assertEquals("ua", response.resourceId()); - Assertions.assertEquals("wrrwoycqucw", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("urut", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("gdakchz", response.filter().osTypes().get(0)); - Assertions.assertEquals("nxm", response.filter().locations().get(0)); - Assertions.assertEquals("wq", response.filter().tagSettings().tags().get("uncuw").get(0)); + Assertions.assertEquals("dtutnwldu", response.location()); + Assertions.assertEquals("uzhyrmewipmvekdx", response.maintenanceConfigurationId()); + Assertions.assertEquals("uqgsj", response.resourceId()); + Assertions.assertEquals("dxgketwzhhzjhfj", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("vmuvgpmu", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("sx", response.filter().osTypes().get(0)); + Assertions.assertEquals("as", response.filter().locations().get(0)); + Assertions.assertEquals("rpfoobr", response.filter().tagSettings().tags().get("fhqlyvi").get(0)); Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsDeleteByResourceGroupWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsDeleteByResourceGroupWithResponseMockTests.java index e5c5f42dd27b..36b51e92d2e8 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsDeleteByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -22,27 +22,27 @@ public final class ConfigurationAssignmentsForResourceGroupsDeleteByResourceGrou @Test public void testDeleteWithResponse() throws Exception { String responseStr - = "{\"location\":\"noda\",\"properties\":{\"maintenanceConfigurationId\":\"qhewj\",\"resourceId\":\"mcgsbostzelnd\",\"filter\":{\"resourceTypes\":[\"tmzlbiojlv\",\"hrbbpneqvcwwyy\",\"r\",\"ochpprpr\"],\"resourceGroups\":[\"okayzejnhlbkp\"],\"osTypes\":[\"cpilj\",\"a\"],\"locations\":[\"echndbnwieholew\",\"wiuub\",\"efqsfapaqtferrqw\",\"x\"],\"tagSettings\":{\"tags\":{\"btqwpwyawbzas\":[\"apjwogqqnobpudcd\"],\"nqnm\":[\"ucljgkyexaoguya\",\"p\",\"dsdaultxijjumf\",\"waz\"],\"dqxtbjwgnyf\":[\"ngz\"],\"jqg\":[\"fzsvtuikzh\"]},\"filterOperator\":\"All\"}}},\"id\":\"mlrqryxynqnz\",\"name\":\"dpsovwxznptgo\",\"type\":\"iyb\"}"; + = "{\"location\":\"edxihchrphkmcrj\",\"properties\":{\"maintenanceConfigurationId\":\"sdf\",\"resourceId\":\"bg\",\"filter\":{\"resourceTypes\":[\"lkdghr\",\"euutlwxezwzh\",\"kvbwnhhtqlgeh\"],\"resourceGroups\":[\"ipifhpfeoajvg\",\"xtxj\"],\"osTypes\":[\"eafidltugsresm\",\"ssjhoiftxfkf\"],\"locations\":[\"prhptillu\"],\"tagSettings\":{\"tags\":{\"p\":[\"gdqoh\",\"cwsldri\",\"etpwbralll\",\"bphbqzmizakakank\"],\"hjlmu\":[\"jzhajoy\"],\"eecjmeis\":[\"xprimrsop\"]},\"filterOperator\":\"All\"}}},\"id\":\"asylwx\",\"name\":\"zaum\",\"type\":\"eoohguufuzboyj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignmentsForResourceGroups() - .deleteByResourceGroupWithResponse("kwv", "gnzvdfbzdixzm", com.azure.core.util.Context.NONE) + .deleteByResourceGroupWithResponse("xgccknfnw", "btmvpdvjdhttza", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("noda", response.location()); - Assertions.assertEquals("qhewj", response.maintenanceConfigurationId()); - Assertions.assertEquals("mcgsbostzelnd", response.resourceId()); - Assertions.assertEquals("tmzlbiojlv", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("okayzejnhlbkp", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("cpilj", response.filter().osTypes().get(0)); - Assertions.assertEquals("echndbnwieholew", response.filter().locations().get(0)); - Assertions.assertEquals("apjwogqqnobpudcd", response.filter().tagSettings().tags().get("btqwpwyawbzas").get(0)); + Assertions.assertEquals("edxihchrphkmcrj", response.location()); + Assertions.assertEquals("sdf", response.maintenanceConfigurationId()); + Assertions.assertEquals("bg", response.resourceId()); + Assertions.assertEquals("lkdghr", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("ipifhpfeoajvg", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("eafidltugsresm", response.filter().osTypes().get(0)); + Assertions.assertEquals("prhptillu", response.filter().locations().get(0)); + Assertions.assertEquals("gdqoh", response.filter().tagSettings().tags().get("p").get(0)); Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsGetByResourceGroupWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsGetByResourceGroupWithResponseMockTests.java index 292894adc1e2..ad3f93bbd277 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsGetByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -22,27 +22,27 @@ public final class ConfigurationAssignmentsForResourceGroupsGetByResourceGroupWi @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"location\":\"tg\",\"properties\":{\"maintenanceConfigurationId\":\"kdghrjeuutlwx\",\"resourceId\":\"w\",\"filter\":{\"resourceTypes\":[\"vbwnhhtq\",\"gehgppi\",\"ifhpf\",\"oajvgcxtxjcs\"],\"resourceGroups\":[\"fidltug\",\"resmkssjhoiftxfk\",\"wegprh\"],\"osTypes\":[\"llu\"],\"locations\":[\"qtgdqohmcwsl\",\"riz\"],\"tagSettings\":{\"tags\":{\"zmizakakan\":[\"ralllibphb\"],\"n\":[\"p\"],\"zaum\":[\"ha\",\"oylhjlmuoyxprimr\",\"opteecj\",\"eislstvasylwx\"],\"f\":[\"oohgu\",\"fuzboyjathwtzolb\",\"emwmdxmebwjs\",\"jpahlxvea\"]},\"filterOperator\":\"Any\"}}},\"id\":\"wmqtibx\",\"name\":\"ijddtvqc\",\"type\":\"tad\"}"; + = "{\"location\":\"jvusfzldmozux\",\"properties\":{\"maintenanceConfigurationId\":\"sbtkadpysownbtgk\",\"resourceId\":\"grjqctojcmi\",\"filter\":{\"resourceTypes\":[\"eypefojyqd\",\"cuplcplcwkhih\"],\"resourceGroups\":[\"hzdsqtzbsrgnow\",\"jhf\",\"mvec\"],\"osTypes\":[\"xmwoteyowcluqo\",\"ekqvgqouwif\",\"mpjw\"],\"locations\":[\"qikfxcv\",\"rfsphuagrt\",\"ikteusqczkvyk\",\"xubyjaffmmfblcqc\"],\"tagSettings\":{\"tags\":{\"seypxiutcxapz\":[\"ibrta\",\"metttwgd\",\"lqxihhrmooiz\"],\"vnh\":[\"rpetogebjoxsl\"],\"lftidgfcwqmpim\":[\"brqnkkzjcjb\",\"rgaehvvibrxjj\",\"toqbeitpkxztmoob\"],\"bawpfajnjwltlwt\":[\"xzhemjyh\",\"hujswtwkozzwcul\"]},\"filterOperator\":\"All\"}}},\"id\":\"ktalhsnvkcdmxz\",\"name\":\"poaimlnwiaaomyl\",\"type\":\"eazulcs\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignmentsForResourceGroups() - .getByResourceGroupWithResponse("fedxihchrphkm", "rjdqnsdfzp", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("agt", "ojocqwogf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("tg", response.location()); - Assertions.assertEquals("kdghrjeuutlwx", response.maintenanceConfigurationId()); - Assertions.assertEquals("w", response.resourceId()); - Assertions.assertEquals("vbwnhhtq", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("fidltug", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("llu", response.filter().osTypes().get(0)); - Assertions.assertEquals("qtgdqohmcwsl", response.filter().locations().get(0)); - Assertions.assertEquals("ralllibphb", response.filter().tagSettings().tags().get("zmizakakan").get(0)); - Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); + Assertions.assertEquals("jvusfzldmozux", response.location()); + Assertions.assertEquals("sbtkadpysownbtgk", response.maintenanceConfigurationId()); + Assertions.assertEquals("grjqctojcmi", response.resourceId()); + Assertions.assertEquals("eypefojyqd", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("hzdsqtzbsrgnow", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("xmwoteyowcluqo", response.filter().osTypes().get(0)); + Assertions.assertEquals("qikfxcv", response.filter().locations().get(0)); + Assertions.assertEquals("ibrta", response.filter().tagSettings().tags().get("seypxiutcxapz").get(0)); + Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsUpdateWithResponseMockTests.java index 41617484a53a..7b5216e5e00c 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsUpdateWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForResourceGroupsUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; @@ -28,40 +28,44 @@ public final class ConfigurationAssignmentsForResourceGroupsUpdateWithResponseMo @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"location\":\"r\",\"properties\":{\"maintenanceConfigurationId\":\"riypoqeyhlqhyk\",\"resourceId\":\"lpyznuciqdsmexi\",\"filter\":{\"resourceTypes\":[\"uxtyasiibmi\",\"bnn\",\"stgnl\",\"hnmgixhcm\"],\"resourceGroups\":[\"qfoudorhcgyy\",\"rotwypundmbxhugc\",\"jkavl\"],\"osTypes\":[\"bmftpmdt\"],\"locations\":[\"ltfvnz\",\"yj\",\"otp\",\"opv\"],\"tagSettings\":{\"tags\":{\"ibcysihsgqc\":[\"qgqqihedsvqwthmk\"],\"zinkfkbgbzbowxeq\":[\"hohsd\",\"mcdzsufcohdxbz\",\"mcmuapc\",\"hdbevwqqxeyskon\"]},\"filterOperator\":\"Any\"}}},\"id\":\"mygvkzqkj\",\"name\":\"eokbze\",\"type\":\"ezrxcczurtleipqx\"}"; + = "{\"location\":\"uij\",\"properties\":{\"maintenanceConfigurationId\":\"xs\",\"resourceId\":\"prtujwsawdd\",\"filter\":{\"resourceTypes\":[\"bxv\",\"titvtzeexavox\"],\"resourceGroups\":[\"lecdmdqbw\",\"ypq\",\"gsfjac\",\"slhhxudbxv\"],\"osTypes\":[\"tnsi\",\"ud\"],\"locations\":[\"mes\"],\"tagSettings\":{\"tags\":{\"ckknhxkizvy\":[\"agzrcxfa\",\"lc\",\"xwmdboxd\",\"gsftufqobrjlnacg\"],\"roylaxxu\":[\"rzvul\",\"r\",\"aeranokqgukkjqnv\"]},\"filterOperator\":\"Any\"}}},\"id\":\"sdosfjbjsvgjr\",\"name\":\"hryvy\",\"type\":\"ytdc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ConfigurationAssignment response = manager.configurationAssignmentsForResourceGroups() - .updateWithResponse("qbnj", "rcgegydcwboxjum", - new ConfigurationAssignmentInner().withLocation("qoli") - .withMaintenanceConfigurationId("aiouaubrjt") - .withResourceId("qxfuojrngif") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("asccbiui", "zdlyjdfqw")) - .withResourceGroups(Arrays.asList("oq", "fdvruz", "lzo")) - .withOsTypes(Arrays.asList("ctfnmdxotng")) - .withLocations(Arrays.asList("ugeyzihgrkyuiza", "snmfpphojeevy")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("mfg", Arrays.asList("zfczbg"), "qqxlajr", - Arrays.asList("glqgleoh", "betnluankrrfxee", "btijvacvbm", "z"))) - .withFilterOperator(TagOperators.ALL))), - com.azure.core.util.Context.NONE) - .getValue(); + ConfigurationAssignment response + = manager.configurationAssignmentsForResourceGroups() + .updateWithResponse("lrcivtsoxfrke", "xpmyyefrpmpdnq", + new ConfigurationAssignmentInner().withLocation("ka") + .withMaintenanceConfigurationId("qvmmbn") + .withResourceId("fr") + .withFilter( + new ConfigurationAssignmentFilterProperties() + .withResourceTypes(Arrays.asList("zmegnitgvk", "lzyqd", "fegcea", "zxwhcansymoyqhlw")) + .withResourceGroups(Arrays.asList("ivbkbxgomfaj")) + .withOsTypes(Arrays.asList("sqvdaeyygux", "kjsqzhzbezkgi")) + .withLocations(Arrays.asList("dxasicddyvv", "skgfmocwahpq")) + .withTagSettings(new TagSettingsProperties() + .withTags( + mapOf("bbjjidjksyxk", Arrays.asList("a", "hhvjhh", "akz"), "svxeizzgwklnsr", + Arrays.asList("vxevblb", "ednljl", "geuaulx", "nsmjbnkppxynen"), "ekkkzd", + Arrays.asList("feycxcktp", "ymerteeammxq"))) + .withFilterOperator(TagOperators.ANY))), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("r", response.location()); - Assertions.assertEquals("riypoqeyhlqhyk", response.maintenanceConfigurationId()); - Assertions.assertEquals("lpyznuciqdsmexi", response.resourceId()); - Assertions.assertEquals("uxtyasiibmi", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("qfoudorhcgyy", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("bmftpmdt", response.filter().osTypes().get(0)); - Assertions.assertEquals("ltfvnz", response.filter().locations().get(0)); - Assertions.assertEquals("qgqqihedsvqwthmk", response.filter().tagSettings().tags().get("ibcysihsgqc").get(0)); + Assertions.assertEquals("uij", response.location()); + Assertions.assertEquals("xs", response.maintenanceConfigurationId()); + Assertions.assertEquals("prtujwsawdd", response.resourceId()); + Assertions.assertEquals("bxv", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("lecdmdqbw", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("tnsi", response.filter().osTypes().get(0)); + Assertions.assertEquals("mes", response.filter().locations().get(0)); + Assertions.assertEquals("agzrcxfa", response.filter().tagSettings().tags().get("ckknhxkizvy").get(0)); Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateWithResponseMockTests.java index 1d5a39d8f78e..68a842177387 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -27,41 +27,40 @@ public final class ConfigurationAssignmentsForSubscriptionsCreateOrUpdateWithRes @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"location\":\"doj\",\"properties\":{\"maintenanceConfigurationId\":\"vavrefdees\",\"resourceId\":\"cuijpxt\",\"filter\":{\"resourceTypes\":[\"prtujwsawdd\",\"ibabxvititvtzeex\"],\"resourceGroups\":[\"xtfglecdmdqb\",\"pypqtgsfj\",\"cbslhhx\",\"db\"],\"osTypes\":[\"d\",\"tnsi\",\"ud\",\"z\"],\"locations\":[\"sckdlp\"],\"tagSettings\":{\"tags\":{\"gsftufqobrjlnacg\":[\"x\",\"a\",\"lc\",\"xwmdboxd\"],\"qnvb\":[\"kknhxkizvytnrzv\",\"lj\",\"aaeranokqgukk\"],\"r\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"],\"dclxgc\":[\"ycy\"]},\"filterOperator\":\"All\"}}},\"id\":\"nwm\",\"name\":\"tmvpdvjdhtt\",\"type\":\"a\"}"; + = "{\"location\":\"jazysdzhezwwvaiq\",\"properties\":{\"maintenanceConfigurationId\":\"vfonkphhqyikvyl\",\"resourceId\":\"yavluwmncstt\",\"filter\":{\"resourceTypes\":[\"bvpoekrsgsgbdhu\"],\"resourceGroups\":[\"njdgkynscliq\",\"zvhxnk\",\"mtk\",\"bo\"],\"osTypes\":[\"nvdxzxhihfrbbc\",\"vqagtltdhlf\"],\"locations\":[\"jpykvgtrdcnifmzz\",\"dymbrny\",\"u\"],\"tagSettings\":{\"tags\":{\"fqroudas\":[\"fwgckhocxvdfffw\"],\"zydvfvf\":[\"vehhrvkbunzozu\",\"hcxgkmoyx\",\"dyuib\",\"mfdn\"],\"cvwmzhwplefa\":[\"naeo\",\"srvhmgorffuki\"],\"dggxdbeesmi\":[\"xilcbtgnhnzey\",\"xtjjfzqlqhycav\"]},\"filterOperator\":\"Any\"}}},\"id\":\"ra\",\"name\":\"iaa\",\"type\":\"iuagydwqfbylyrfg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ConfigurationAssignment response = manager.configurationAssignmentsForSubscriptions() - .define("qdnfwqzdz") - .withRegion("ilaxhn") - .withMaintenanceConfigurationId("lyvijouwiv") - .withResourceId("oyzunbixxr") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("cpwpg", "lrcivtsoxfrke", "xpmyyefrpmpdnq")) - .withResourceGroups(Arrays.asList("awaoqvmmbnpqfrt")) - .withOsTypes(Arrays.asList("zmegnitgvk", "lzyqd", "fegcea", "zxwhcansymoyqhlw")) - .withLocations(Arrays.asList("ivbkbxgomfaj")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("gat", Arrays.asList("vdaeyyguxakjsq", "hzbezkgi", "sidxasicdd", "vvjskgfmocwahp"), - "bbjjidjksyxk", Arrays.asList("a", "hhvjhh", "akz"), "svxeizzgwklnsr", - Arrays.asList("vxevblb", "ednljl", "geuaulx", "nsmjbnkppxynen"))) - .withFilterOperator(TagOperators.ANY))) - .create(); + ConfigurationAssignment response + = manager.configurationAssignmentsForSubscriptions() + .define("ilozapeewchpxlk") + .withRegion("kuziycsle") + .withMaintenanceConfigurationId("uztcktyhjtqed") + .withResourceId("zulwmmrqzzrrj") + .withFilter(new ConfigurationAssignmentFilterProperties() + .withResourceTypes(Arrays.asList("ydzgkrvqeevtoe", "r")) + .withResourceGroups(Arrays.asList("nwy")) + .withOsTypes(Arrays.asList("dmovzvfva", "wzqa")) + .withLocations(Arrays.asList("gzuriglaecxndt", "cokpv")) + .withTagSettings(new TagSettingsProperties() + .withTags(mapOf("npkc", Arrays.asList("mldgxobfirc"), "jlb", Arrays.asList("yzriykhy", "wf"))) + .withFilterOperator(TagOperators.ANY))) + .create(); - Assertions.assertEquals("doj", response.location()); - Assertions.assertEquals("vavrefdees", response.maintenanceConfigurationId()); - Assertions.assertEquals("cuijpxt", response.resourceId()); - Assertions.assertEquals("prtujwsawdd", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("xtfglecdmdqb", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("d", response.filter().osTypes().get(0)); - Assertions.assertEquals("sckdlp", response.filter().locations().get(0)); - Assertions.assertEquals("x", response.filter().tagSettings().tags().get("gsftufqobrjlnacg").get(0)); - Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); + Assertions.assertEquals("jazysdzhezwwvaiq", response.location()); + Assertions.assertEquals("vfonkphhqyikvyl", response.maintenanceConfigurationId()); + Assertions.assertEquals("yavluwmncstt", response.resourceId()); + Assertions.assertEquals("bvpoekrsgsgbdhu", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("njdgkynscliq", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("nvdxzxhihfrbbc", response.filter().osTypes().get(0)); + Assertions.assertEquals("jpykvgtrdcnifmzz", response.filter().locations().get(0)); + Assertions.assertEquals("fwgckhocxvdfffw", response.filter().tagSettings().tags().get("fqroudas").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); } // Use "Map.of" if available diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteWithResponseMockTests.java index 8989b839ee77..212f65e1ae96 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -22,27 +22,27 @@ public final class ConfigurationAssignmentsForSubscriptionsDeleteWithResponseMoc @Test public void testDeleteWithResponse() throws Exception { String responseStr - = "{\"location\":\"izxfpxt\",\"properties\":{\"maintenanceConfigurationId\":\"cja\",\"resourceId\":\"t\",\"filter\":{\"resourceTypes\":[\"qaz\",\"mtggu\",\"pijrajcivmmghf\",\"fiwrxgkn\"],\"resourceGroups\":[\"yinzqodfvpgs\"],\"osTypes\":[\"gsgbpfgzdjt\"],\"locations\":[\"flbqvgaq\",\"lgafcqusrdve\"],\"tagSettings\":{\"tags\":{\"gsjj\":[\"tutnwlduycvuzhyr\",\"ewipm\",\"ekdxuku\"],\"mhv\":[\"n\",\"xgketwz\",\"hzjhf\"],\"uzjyihsasbhudypo\":[\"uvgp\",\"uneqsxvmhf\"]},\"filterOperator\":\"All\"}}},\"id\":\"ms\",\"name\":\"ynsqyrpfoobr\",\"type\":\"ttymsjny\"}"; + = "{\"location\":\"gxxlxsffgcvizq\",\"properties\":{\"maintenanceConfigurationId\":\"l\",\"resourceId\":\"lyoupfgfbkju\",\"filter\":{\"resourceTypes\":[\"gkfmins\",\"owzfttsttkt\"],\"resourceGroups\":[\"bqactxtgzukx\"],\"osTypes\":[\"m\",\"tg\",\"qqxhrnxrxcpj\"],\"locations\":[\"av\",\"k\",\"dzf\"],\"tagSettings\":{\"tags\":{\"xyiopidkqqfku\":[\"jlfrq\",\"tbajlkatn\"],\"rxkpmloazuruoc\":[\"cxkdmligovi\"],\"ordilmywwtkgkxny\":[\"oorb\",\"eoybfhjxakvvjgs\"],\"uewbc\":[\"abgyvudt\"]},\"filterOperator\":\"All\"}}},\"id\":\"uwhcjyxccybv\",\"name\":\"ayakkudzpx\",\"type\":\"wjplma\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignmentsForSubscriptions() - .deleteWithResponse("cporxvxcjz", com.azure.core.util.Context.NONE) + .deleteWithResponse("ksbpimlqoljx", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("izxfpxt", response.location()); - Assertions.assertEquals("cja", response.maintenanceConfigurationId()); - Assertions.assertEquals("t", response.resourceId()); - Assertions.assertEquals("qaz", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("yinzqodfvpgs", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("gsgbpfgzdjt", response.filter().osTypes().get(0)); - Assertions.assertEquals("flbqvgaq", response.filter().locations().get(0)); - Assertions.assertEquals("tutnwlduycvuzhyr", response.filter().tagSettings().tags().get("gsjj").get(0)); + Assertions.assertEquals("gxxlxsffgcvizq", response.location()); + Assertions.assertEquals("l", response.maintenanceConfigurationId()); + Assertions.assertEquals("lyoupfgfbkju", response.resourceId()); + Assertions.assertEquals("gkfmins", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("bqactxtgzukx", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("m", response.filter().osTypes().get(0)); + Assertions.assertEquals("av", response.filter().locations().get(0)); + Assertions.assertEquals("jlfrq", response.filter().tagSettings().tags().get("xyiopidkqqfku").get(0)); Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetWithResponseMockTests.java index 7a9f0e46541b..8c43ed8bd528 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -22,27 +22,27 @@ public final class ConfigurationAssignmentsForSubscriptionsGetWithResponseMockTe @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"location\":\"bjoxs\",\"properties\":{\"maintenanceConfigurationId\":\"nhl\",\"resourceId\":\"rqnkkzjcjbtr\",\"filter\":{\"resourceTypes\":[\"vvib\"],\"resourceGroups\":[\"jsto\"],\"osTypes\":[\"it\",\"kxzt\",\"oobklftidgfcwq\"],\"locations\":[\"maqxzhemjyh\"],\"tagSettings\":{\"tags\":{\"vkcdmxzr\":[\"wtwko\",\"zwculkbawpfajnj\",\"ltlwtjjguktalhs\"],\"eazulcs\":[\"aimlnwiaaom\",\"l\"],\"ousnfepgfewe\":[\"hwwn\",\"jhlfzswpchwahf\"]},\"filterOperator\":\"All\"}}},\"id\":\"xgncxyk\",\"name\":\"hdjhlimmbcx\",\"type\":\"h\"}"; + = "{\"location\":\"nmwcpmgu\",\"properties\":{\"maintenanceConfigurationId\":\"raufactkahzova\",\"resourceId\":\"ziuxxpshnee\",\"filter\":{\"resourceTypes\":[\"gs\",\"qubkw\",\"lenrd\"],\"resourceGroups\":[\"ujbazpjuohminyfl\",\"orwmduvwpklv\",\"w\"],\"osTypes\":[\"dxpgpqchiszepnnb\",\"crxgibb\"],\"locations\":[\"confozauors\",\"kokwbqplhlvnu\",\"epzl\"],\"tagSettings\":{\"tags\":{\"alywjhhgdn\":[\"soldweyuqdunv\",\"nnrwrbiork\"],\"cubiipuipw\":[\"msi\",\"fomiloxgg\",\"ufiqndieuzaof\",\"chvcyyysfgdo\"],\"ilbywdxsm\":[\"onmacjekniz\",\"hqvcimpevfgmblr\"],\"jfnynszqujizdvoq\":[\"cwrwfs\"]},\"filterOperator\":\"Any\"}}},\"id\":\"yo\",\"name\":\"bblgyavut\",\"type\":\"thjoxoism\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignmentsForSubscriptions() - .getWithResponse("zhyrpeto", com.azure.core.util.Context.NONE) + .getWithResponse("futacoebjvewzc", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("bjoxs", response.location()); - Assertions.assertEquals("nhl", response.maintenanceConfigurationId()); - Assertions.assertEquals("rqnkkzjcjbtr", response.resourceId()); - Assertions.assertEquals("vvib", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("jsto", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("it", response.filter().osTypes().get(0)); - Assertions.assertEquals("maqxzhemjyh", response.filter().locations().get(0)); - Assertions.assertEquals("wtwko", response.filter().tagSettings().tags().get("vkcdmxzr").get(0)); - Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); + Assertions.assertEquals("nmwcpmgu", response.location()); + Assertions.assertEquals("raufactkahzova", response.maintenanceConfigurationId()); + Assertions.assertEquals("ziuxxpshnee", response.resourceId()); + Assertions.assertEquals("gs", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("ujbazpjuohminyfl", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("dxpgpqchiszepnnb", response.filter().osTypes().get(0)); + Assertions.assertEquals("confozauors", response.filter().locations().get(0)); + Assertions.assertEquals("soldweyuqdunv", response.filter().tagSettings().tags().get("alywjhhgdn").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsListMockTests.java new file mode 100644 index 000000000000..2b688ade73ca --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsForSubscriptionsListMockTests.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.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; +import com.azure.resourcemanager.maintenance.models.TagOperators; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ConfigurationAssignmentsForSubscriptionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"location\":\"tcyohpfkyrk\",\"properties\":{\"maintenanceConfigurationId\":\"giogsjkmnwqjno\",\"resourceId\":\"iyhddvi\",\"filter\":{\"resourceTypes\":[\"fnmntfpmvmemfn\",\"zdwvvbalxl\",\"lchpodbzevwrdn\",\"fukuvsjcswsmystu\"],\"resourceGroups\":[\"ypfcvlerchpqbmf\",\"jbabwidf\"],\"osTypes\":[\"spuunnoxyhkxgq\",\"drihpfhoqcaaewda\",\"mdjvlpj\",\"xkzb\"],\"locations\":[\"geivsiykzkdncj\",\"xonbzoggculapz\"],\"tagSettings\":{\"tags\":{\"uxrkjp\":[\"ogtqxepnylbf\",\"ajlyjtlvofqzhv\",\"cib\",\"fmo\"],\"fzwiivwzjbhyz\":[\"w\"],\"q\":[\"jrkambtrnegvmnv\"]},\"filterOperator\":\"All\"}}},\"id\":\"dspastjbkkdmfl\",\"name\":\"est\",\"type\":\"jlxr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.configurationAssignmentsForSubscriptions().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("tcyohpfkyrk", response.iterator().next().location()); + Assertions.assertEquals("giogsjkmnwqjno", response.iterator().next().maintenanceConfigurationId()); + Assertions.assertEquals("iyhddvi", response.iterator().next().resourceId()); + Assertions.assertEquals("fnmntfpmvmemfn", response.iterator().next().filter().resourceTypes().get(0)); + Assertions.assertEquals("ypfcvlerchpqbmf", response.iterator().next().filter().resourceGroups().get(0)); + Assertions.assertEquals("spuunnoxyhkxgq", response.iterator().next().filter().osTypes().get(0)); + Assertions.assertEquals("geivsiykzkdncj", response.iterator().next().filter().locations().get(0)); + Assertions.assertEquals("ogtqxepnylbf", + response.iterator().next().filter().tagSettings().tags().get("uxrkjp").get(0)); + Assertions.assertEquals(TagOperators.ALL, response.iterator().next().filter().tagSettings().filterOperator()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentWithResponseMockTests.java index 7004432bdfb8..822b3e33508a 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetParentWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -22,28 +22,28 @@ public final class ConfigurationAssignmentsGetParentWithResponseMockTests { @Test public void testGetParentWithResponse() throws Exception { String responseStr - = "{\"location\":\"n\",\"properties\":{\"maintenanceConfigurationId\":\"n\",\"resourceId\":\"ph\",\"filter\":{\"resourceTypes\":[\"odlqiyntor\",\"ihleos\",\"swsrms\",\"yzrpzbchckqqzq\"],\"resourceGroups\":[\"iysui\"],\"osTypes\":[\"nkedyatrwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\",\"nsorgjhxbldt\"],\"locations\":[\"rlkdmtncvokotl\",\"xdy\"],\"tagSettings\":{\"tags\":{\"cikhnv\":[\"cogjltdtbn\",\"hadoocrk\"]},\"filterOperator\":\"All\"}}},\"id\":\"gxqquezik\",\"name\":\"wggxkallat\",\"type\":\"elwuipi\"}"; + = "{\"location\":\"dknnqvsazn\",\"properties\":{\"maintenanceConfigurationId\":\"orudsgsa\",\"resourceId\":\"kycgrauwj\",\"filter\":{\"resourceTypes\":[\"eburu\",\"dmovsm\",\"l\"],\"resourceGroups\":[\"b\"],\"osTypes\":[\"efkifr\",\"tpuqujmq\"],\"locations\":[\"fbtndoaong\",\"jcntuj\",\"tcje\",\"ftwwaezkojvdc\"],\"tagSettings\":{\"tags\":{\"gokdwbwhks\":[\"ouicybxarzgszu\",\"oxciqopidoamcio\",\"hkh\",\"zxkhnzbonlwnto\"],\"lmnguxaw\":[\"cmrvexzt\",\"bt\",\"gsfraoyzkoow\"],\"utwpfhp\":[\"ldsyuuximerqfob\",\"yznkby\"],\"dlhewp\":[\"m\",\"r\",\"kdsnfdsdoakgtdl\",\"kkze\"]},\"filterOperator\":\"All\"}}},\"id\":\"ttwvogvbbe\",\"name\":\"dcngqqmoakufgmj\",\"type\":\"rwr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConfigurationAssignment response = manager.configurationAssignments() - .getParentWithResponse("aeneqnzarrwl", "uu", "jfqka", "e", "iipfpubj", "bwwift", "hqkvpuvksgplsak", + .getParentWithResponse("nvxbvt", "udutnco", "mr", "xqtvcofu", "f", "vkg", "u", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("n", response.location()); - Assertions.assertEquals("n", response.maintenanceConfigurationId()); - Assertions.assertEquals("ph", response.resourceId()); - Assertions.assertEquals("odlqiyntor", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("iysui", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("nkedyatrwyhqmib", response.filter().osTypes().get(0)); - Assertions.assertEquals("rlkdmtncvokotl", response.filter().locations().get(0)); - Assertions.assertEquals("cogjltdtbn", response.filter().tagSettings().tags().get("cikhnv").get(0)); + Assertions.assertEquals("dknnqvsazn", response.location()); + Assertions.assertEquals("orudsgsa", response.maintenanceConfigurationId()); + Assertions.assertEquals("kycgrauwj", response.resourceId()); + Assertions.assertEquals("eburu", response.filter().resourceTypes().get(0)); + Assertions.assertEquals("b", response.filter().resourceGroups().get(0)); + Assertions.assertEquals("efkifr", response.filter().osTypes().get(0)); + Assertions.assertEquals("fbtndoaong", response.filter().locations().get(0)); + Assertions.assertEquals("ouicybxarzgszu", response.filter().tagSettings().tags().get("gokdwbwhks").get(0)); Assertions.assertEquals(TagOperators.ALL, response.filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetWithResponseMockTests.java deleted file mode 100644 index b04184232a89..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationAssignmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"cmrvexzt\",\"properties\":{\"maintenanceConfigurationId\":\"qgsfraoyzkoow\",\"resourceId\":\"mnguxawqaldsyu\",\"filter\":{\"resourceTypes\":[\"erqf\",\"bw\",\"znkbykutwpfhpagm\",\"r\"],\"resourceGroups\":[\"snfdsdoakgtdl\",\"kkze\",\"dlhewp\",\"sdsttwvog\"],\"osTypes\":[\"ejdcngqqmoakuf\",\"m\"],\"locations\":[\"wr\"],\"tagSettings\":{\"tags\":{\"opbminrfdw\":[\"aenuuz\"],\"hoftr\":[\"uhhziuiefozbhdm\",\"mlmz\"],\"hxicslfaoqz\":[\"equi\"]},\"filterOperator\":\"Any\"}}},\"id\":\"lhalnswh\",\"name\":\"csphkaiv\",\"type\":\"itqscywuggwoluhc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationAssignment response = manager.configurationAssignments() - .getWithResponse("ybxarzgszu", "oxciqopidoamcio", "hkh", "zxkhnzbonlwnto", "gokdwbwhks", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("cmrvexzt", response.location()); - Assertions.assertEquals("qgsfraoyzkoow", response.maintenanceConfigurationId()); - Assertions.assertEquals("mnguxawqaldsyu", response.resourceId()); - Assertions.assertEquals("erqf", response.filter().resourceTypes().get(0)); - Assertions.assertEquals("snfdsdoakgtdl", response.filter().resourceGroups().get(0)); - Assertions.assertEquals("ejdcngqqmoakuf", response.filter().osTypes().get(0)); - Assertions.assertEquals("wr", response.filter().locations().get(0)); - Assertions.assertEquals("aenuuz", response.filter().tagSettings().tags().get("opbminrfdw").get(0)); - Assertions.assertEquals(TagOperators.ANY, response.filter().tagSettings().filterOperator()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListMockTests.java deleted file mode 100644 index bf2b4a47749d..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationAssignmentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"dscwxqupevzhf\",\"properties\":{\"maintenanceConfigurationId\":\"txhojujb\",\"resourceId\":\"elmcuvhixbjxyfw\",\"filter\":{\"resourceTypes\":[\"coolsttpkiwkkb\"],\"resourceGroups\":[\"rywvtylbfpn\",\"urdoi\",\"iithtywu\",\"xcbihw\"],\"osTypes\":[\"fdntwjchrdgoih\"],\"locations\":[\"wct\",\"ndz\",\"luudfdlwggytsb\",\"tov\"],\"tagSettings\":{\"tags\":{\"ffcdmqnrojl\":[\"inqfiufxqknpirgn\",\"pttwqmsn\"],\"ft\":[\"jnkrxf\",\"ddhcratizzr\",\"nasx\"],\"wesgogczh\":[\"qyzhf\"]},\"filterOperator\":\"Any\"}}},\"id\":\"krlgnyhm\",\"name\":\"ssxkkgthr\",\"type\":\"gh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.configurationAssignments() - .list("pqqmted", "tmmjihyeozph", "wau", "qncygupkvi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dscwxqupevzhf", response.iterator().next().location()); - Assertions.assertEquals("txhojujb", response.iterator().next().maintenanceConfigurationId()); - Assertions.assertEquals("elmcuvhixbjxyfw", response.iterator().next().resourceId()); - Assertions.assertEquals("coolsttpkiwkkb", response.iterator().next().filter().resourceTypes().get(0)); - Assertions.assertEquals("rywvtylbfpn", response.iterator().next().filter().resourceGroups().get(0)); - Assertions.assertEquals("fdntwjchrdgoih", response.iterator().next().filter().osTypes().get(0)); - Assertions.assertEquals("wct", response.iterator().next().filter().locations().get(0)); - Assertions.assertEquals("inqfiufxqknpirgn", - response.iterator().next().filter().tagSettings().tags().get("ffcdmqnrojl").get(0)); - Assertions.assertEquals(TagOperators.ANY, response.iterator().next().filter().tagSettings().filterOperator()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentMockTests.java index 605da01d7d37..fccbce5a6409 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsListParentMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; @@ -23,28 +23,28 @@ public final class ConfigurationAssignmentsListParentMockTests { @Test public void testListParent() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"tkkgllqwjy\",\"properties\":{\"maintenanceConfigurationId\":\"ayvblmhvkzuhbx\",\"resourceId\":\"yhgsopbyrqufe\",\"filter\":{\"resourceTypes\":[\"wz\"],\"resourceGroups\":[\"hlmctlpdngitvgb\",\"hrixkwmy\",\"jejveg\"],\"osTypes\":[\"pna\",\"xexccbdreaxhcexd\",\"rvqahqkghtpwi\",\"nhyjsv\"],\"locations\":[\"xzb\",\"voowvr\",\"mtg\"],\"tagSettings\":{\"tags\":{\"yhgfipnsx\":[\"ostronz\"],\"pvuzlmv\":[\"cwaekrrjre\",\"fxtsgum\",\"jglikkxwslolb\"],\"noigbrnjwmwk\":[\"lfktgplcrpwjxe\"],\"ou\":[\"bsazejjoqka\",\"fhsxttaugz\",\"nfaazpxdtnkdmkq\",\"jlwuenvrkp\"]},\"filterOperator\":\"All\"}}},\"id\":\"ebqaaysjkixqtnq\",\"name\":\"tezlwff\",\"type\":\"iakp\"}]}"; + = "{\"value\":[{\"location\":\"zfbn\",\"properties\":{\"maintenanceConfigurationId\":\"ctlpdngitvgb\",\"resourceId\":\"rixkwmyijejve\",\"filter\":{\"resourceTypes\":[\"pna\",\"xexccbdreaxhcexd\",\"rvqahqkghtpwi\",\"nhyjsv\"],\"resourceGroups\":[\"xzb\",\"voowvr\",\"mtg\"],\"osTypes\":[\"pyostronzmyhgfi\",\"nsxkmcwaekrrjr\",\"afxtsgum\",\"jglikkxwslolb\"],\"locations\":[\"uzlm\",\"felfktg\"],\"tagSettings\":{\"tags\":{\"zejjoqk\":[\"wjxeznoigbr\",\"jwmwkpnbs\"]},\"filterOperator\":\"Any\"}}},\"id\":\"sxtta\",\"name\":\"gzxnfaazpxdtnk\",\"type\":\"mkqjj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.configurationAssignments() - .listParent("birryuzhl", "kj", "qrvqq", "atjinrvgoupmfiib", "ggjioolvr", "x", + .listParent("x", "v", "kkgll", "wjygvjayvblmhvk", "uhbxvvy", "gsopbyrqufegxu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("tkkgllqwjy", response.iterator().next().location()); - Assertions.assertEquals("ayvblmhvkzuhbx", response.iterator().next().maintenanceConfigurationId()); - Assertions.assertEquals("yhgsopbyrqufe", response.iterator().next().resourceId()); - Assertions.assertEquals("wz", response.iterator().next().filter().resourceTypes().get(0)); - Assertions.assertEquals("hlmctlpdngitvgb", response.iterator().next().filter().resourceGroups().get(0)); - Assertions.assertEquals("pna", response.iterator().next().filter().osTypes().get(0)); - Assertions.assertEquals("xzb", response.iterator().next().filter().locations().get(0)); - Assertions.assertEquals("ostronz", - response.iterator().next().filter().tagSettings().tags().get("yhgfipnsx").get(0)); - Assertions.assertEquals(TagOperators.ALL, response.iterator().next().filter().tagSettings().filterOperator()); + Assertions.assertEquals("zfbn", response.iterator().next().location()); + Assertions.assertEquals("ctlpdngitvgb", response.iterator().next().maintenanceConfigurationId()); + Assertions.assertEquals("rixkwmyijejve", response.iterator().next().resourceId()); + Assertions.assertEquals("pna", response.iterator().next().filter().resourceTypes().get(0)); + Assertions.assertEquals("xzb", response.iterator().next().filter().resourceGroups().get(0)); + Assertions.assertEquals("pyostronzmyhgfi", response.iterator().next().filter().osTypes().get(0)); + Assertions.assertEquals("uzlm", response.iterator().next().filter().locations().get(0)); + Assertions.assertEquals("wjxeznoigbr", + response.iterator().next().filter().tagSettings().tags().get("zejjoqk").get(0)); + Assertions.assertEquals(TagOperators.ANY, response.iterator().next().filter().tagSettings().filterOperator()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsWithinSubscriptionsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsWithinSubscriptionsListMockTests.java deleted file mode 100644 index 6c55f1cf7a0f..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ConfigurationAssignmentsWithinSubscriptionsListMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignment; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationAssignmentsWithinSubscriptionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"zeyqxtjjfzqlqhyc\",\"properties\":{\"maintenanceConfigurationId\":\"dggxdbeesmi\",\"resourceId\":\"nlrariaawiuagy\",\"filter\":{\"resourceTypes\":[\"bylyrfgia\",\"tcojocqwo\"],\"resourceGroups\":[\"zjvusfzldmo\",\"uxylfsbtkadpy\",\"own\"],\"osTypes\":[\"kb\",\"grjqctojcmi\",\"of\"],\"locations\":[\"pe\",\"ojyqdhcuplcplcw\",\"hihihlhzdsqtzbsr\",\"nowc\"],\"tagSettings\":{\"tags\":{\"wotey\":[\"vecactx\"],\"uagrttikteusqc\":[\"cluqovekqvgqo\",\"wifzmp\",\"wyivqikf\",\"cvhrfsp\"],\"metttwgd\":[\"vyklxuby\",\"affmmfblcqc\",\"ubgq\",\"brta\"]},\"filterOperator\":\"Any\"}}},\"id\":\"ihhrmo\",\"name\":\"i\",\"type\":\"qseypxiutcxa\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.configurationAssignmentsWithinSubscriptions().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zeyqxtjjfzqlqhyc", response.iterator().next().location()); - Assertions.assertEquals("dggxdbeesmi", response.iterator().next().maintenanceConfigurationId()); - Assertions.assertEquals("nlrariaawiuagy", response.iterator().next().resourceId()); - Assertions.assertEquals("bylyrfgia", response.iterator().next().filter().resourceTypes().get(0)); - Assertions.assertEquals("zjvusfzldmo", response.iterator().next().filter().resourceGroups().get(0)); - Assertions.assertEquals("kb", response.iterator().next().filter().osTypes().get(0)); - Assertions.assertEquals("pe", response.iterator().next().filter().locations().get(0)); - Assertions.assertEquals("vecactx", - response.iterator().next().filter().tagSettings().tags().get("wotey").get(0)); - Assertions.assertEquals(TagOperators.ANY, response.iterator().next().filter().tagSettings().filterOperator()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputLinuxParametersTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputLinuxParametersTests.java deleted file mode 100644 index 0a8fc76548fc..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputLinuxParametersTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InputLinuxParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InputLinuxParameters model = BinaryData.fromString( - "{\"packageNameMasksToExclude\":[\"xorrqnb\",\"oczvy\",\"fqrvkdvjsllrmvvd\",\"watkpnpulexxb\"],\"packageNameMasksToInclude\":[\"truwiqzb\",\"j\",\"sovmyokacspkwl\",\"zdobpxjmflbvvnch\"],\"classificationsToInclude\":[\"ciwwzjuqkhr\"]}") - .toObject(InputLinuxParameters.class); - Assertions.assertEquals("xorrqnb", model.packageNameMasksToExclude().get(0)); - Assertions.assertEquals("truwiqzb", model.packageNameMasksToInclude().get(0)); - Assertions.assertEquals("ciwwzjuqkhr", model.classificationsToInclude().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InputLinuxParameters model = new InputLinuxParameters() - .withPackageNameMasksToExclude(Arrays.asList("xorrqnb", "oczvy", "fqrvkdvjsllrmvvd", "watkpnpulexxb")) - .withPackageNameMasksToInclude(Arrays.asList("truwiqzb", "j", "sovmyokacspkwl", "zdobpxjmflbvvnch")) - .withClassificationsToInclude(Arrays.asList("ciwwzjuqkhr")); - model = BinaryData.fromObject(model).toObject(InputLinuxParameters.class); - Assertions.assertEquals("xorrqnb", model.packageNameMasksToExclude().get(0)); - Assertions.assertEquals("truwiqzb", model.packageNameMasksToInclude().get(0)); - Assertions.assertEquals("ciwwzjuqkhr", model.classificationsToInclude().get(0)); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputPatchConfigurationTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputPatchConfigurationTests.java deleted file mode 100644 index 8c6dff7ecd7a..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputPatchConfigurationTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; -import com.azure.resourcemanager.maintenance.models.InputPatchConfiguration; -import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InputPatchConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InputPatchConfiguration model = BinaryData.fromString( - "{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"w\",\"ujjugwdkcglh\",\"lazjdyggdtjixhbk\",\"ofqweykhmenevfye\"],\"kbNumbersToInclude\":[\"hybcibv\",\"vdcsitynn\"],\"classificationsToInclude\":[\"dectehfiqsc\",\"eypvhezrkg\",\"hcjrefovgmk\",\"sle\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"jpkcattpng\",\"cr\",\"czsqpjhvm\",\"ajvnysounqe\"],\"packageNameMasksToInclude\":[\"oaeupfhyhltrpmo\"],\"classificationsToInclude\":[\"cma\",\"u\",\"kthfui\",\"aodsfcpkv\"]}}") - .toObject(InputPatchConfiguration.class); - Assertions.assertEquals(RebootOptions.NEVER, model.rebootSetting()); - Assertions.assertEquals("w", model.windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("hybcibv", model.windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("dectehfiqsc", model.windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, model.windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("jpkcattpng", model.linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("oaeupfhyhltrpmo", model.linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("cma", model.linuxParameters().classificationsToInclude().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InputPatchConfiguration model = new InputPatchConfiguration().withRebootSetting(RebootOptions.NEVER) - .withWindowsParameters(new InputWindowsParameters() - .withKbNumbersToExclude(Arrays.asList("w", "ujjugwdkcglh", "lazjdyggdtjixhbk", "ofqweykhmenevfye")) - .withKbNumbersToInclude(Arrays.asList("hybcibv", "vdcsitynn")) - .withClassificationsToInclude(Arrays.asList("dectehfiqsc", "eypvhezrkg", "hcjrefovgmk", "sle")) - .withExcludeKbsRequiringReboot(true)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude(Arrays.asList("jpkcattpng", "cr", "czsqpjhvm", "ajvnysounqe")) - .withPackageNameMasksToInclude(Arrays.asList("oaeupfhyhltrpmo")) - .withClassificationsToInclude(Arrays.asList("cma", "u", "kthfui", "aodsfcpkv"))); - model = BinaryData.fromObject(model).toObject(InputPatchConfiguration.class); - Assertions.assertEquals(RebootOptions.NEVER, model.rebootSetting()); - Assertions.assertEquals("w", model.windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("hybcibv", model.windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("dectehfiqsc", model.windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, model.windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("jpkcattpng", model.linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("oaeupfhyhltrpmo", model.linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("cma", model.linuxParameters().classificationsToInclude().get(0)); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputWindowsParametersTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputWindowsParametersTests.java deleted file mode 100644 index 8503b8a05887..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/InputWindowsParametersTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class InputWindowsParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InputWindowsParameters model = BinaryData.fromString( - "{\"kbNumbersToExclude\":[\"puozmyzydag\",\"uaxbezyiuokkt\"],\"kbNumbersToInclude\":[\"dxwzywqsmbsurexi\",\"o\",\"yocf\"],\"classificationsToInclude\":[\"s\",\"mddystkiiux\"],\"excludeKbsRequiringReboot\":true}") - .toObject(InputWindowsParameters.class); - Assertions.assertEquals("puozmyzydag", model.kbNumbersToExclude().get(0)); - Assertions.assertEquals("dxwzywqsmbsurexi", model.kbNumbersToInclude().get(0)); - Assertions.assertEquals("s", model.classificationsToInclude().get(0)); - Assertions.assertEquals(true, model.excludeKbsRequiringReboot()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InputWindowsParameters model - = new InputWindowsParameters().withKbNumbersToExclude(Arrays.asList("puozmyzydag", "uaxbezyiuokkt")) - .withKbNumbersToInclude(Arrays.asList("dxwzywqsmbsurexi", "o", "yocf")) - .withClassificationsToInclude(Arrays.asList("s", "mddystkiiux")) - .withExcludeKbsRequiringReboot(true); - model = BinaryData.fromObject(model).toObject(InputWindowsParameters.class); - Assertions.assertEquals("puozmyzydag", model.kbNumbersToExclude().get(0)); - Assertions.assertEquals("dxwzywqsmbsurexi", model.kbNumbersToInclude().get(0)); - Assertions.assertEquals("s", model.classificationsToInclude().get(0)); - Assertions.assertEquals(true, model.excludeKbsRequiringReboot()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListApplyUpdateTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListApplyUpdateTests.java deleted file mode 100644 index 7fbacc653a21..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListApplyUpdateTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ApplyUpdateInner; -import com.azure.resourcemanager.maintenance.models.ListApplyUpdate; -import com.azure.resourcemanager.maintenance.models.UpdateStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ListApplyUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListApplyUpdate model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"status\":\"InProgress\",\"resourceId\":\"ualaexqpvfadmw\",\"lastUpdateTime\":\"2021-02-27T12:21:31Z\"},\"id\":\"gvxp\",\"name\":\"gomz\",\"type\":\"fmisg\"}]}") - .toObject(ListApplyUpdate.class); - Assertions.assertEquals(UpdateStatus.IN_PROGRESS, model.value().get(0).status()); - Assertions.assertEquals("ualaexqpvfadmw", model.value().get(0).resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-27T12:21:31Z"), model.value().get(0).lastUpdateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListApplyUpdate model - = new ListApplyUpdate().withValue(Arrays.asList(new ApplyUpdateInner().withStatus(UpdateStatus.IN_PROGRESS) - .withResourceId("ualaexqpvfadmw") - .withLastUpdateTime(OffsetDateTime.parse("2021-02-27T12:21:31Z")))); - model = BinaryData.fromObject(model).toObject(ListApplyUpdate.class); - Assertions.assertEquals(UpdateStatus.IN_PROGRESS, model.value().get(0).status()); - Assertions.assertEquals("ualaexqpvfadmw", model.value().get(0).resourceId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-27T12:21:31Z"), model.value().get(0).lastUpdateTime()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListConfigurationAssignmentsResultTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListConfigurationAssignmentsResultTests.java deleted file mode 100644 index 8b5ddc997a6b..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListConfigurationAssignmentsResultTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner; -import com.azure.resourcemanager.maintenance.models.ConfigurationAssignmentFilterProperties; -import com.azure.resourcemanager.maintenance.models.ListConfigurationAssignmentsResult; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ListConfigurationAssignmentsResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListConfigurationAssignmentsResult model = BinaryData.fromString( - "{\"value\":[{\"location\":\"xpkd\",\"properties\":{\"maintenanceConfigurationId\":\"aiuebbaumnyqu\",\"resourceId\":\"deoj\",\"filter\":{\"resourceTypes\":[\"khsmtxpsiebt\",\"hvpesapskrdqm\",\"jjdhtld\"],\"resourceGroups\":[\"zxuutkncwscwsvl\",\"otogtwrupqs\",\"vnm\"],\"osTypes\":[\"kvceoveilovnotyf\",\"fcnj\",\"k\"],\"locations\":[\"dhbt\"],\"tagSettings\":{\"tags\":{\"ywpnvjt\":[]},\"filterOperator\":\"All\"}}},\"id\":\"rmclfplphoxu\",\"name\":\"crpab\",\"type\":\"ye\"},{\"location\":\"bjtazqugxywpmu\",\"properties\":{\"maintenanceConfigurationId\":\"jzwf\",\"resourceId\":\"q\",\"filter\":{\"resourceTypes\":[\"suyonobglaocq\",\"tcc\",\"g\"],\"resourceGroups\":[\"xy\"],\"osTypes\":[\"oyrxvwfudwpzntxh\",\"zhlrqjb\",\"ck\",\"rlhrxs\"],\"locations\":[\"vpycanuzbp\",\"kafkuwbcrnwbm\",\"hhseyv\",\"us\"],\"tagSettings\":{\"tags\":{\"hspkdeemao\":[],\"mx\":[]},\"filterOperator\":\"All\"}}},\"id\":\"t\",\"name\":\"elmqk\",\"type\":\"hahvljuahaq\"}]}") - .toObject(ListConfigurationAssignmentsResult.class); - Assertions.assertEquals("xpkd", model.value().get(0).location()); - Assertions.assertEquals("aiuebbaumnyqu", model.value().get(0).maintenanceConfigurationId()); - Assertions.assertEquals("deoj", model.value().get(0).resourceId()); - Assertions.assertEquals("khsmtxpsiebt", model.value().get(0).filter().resourceTypes().get(0)); - Assertions.assertEquals("zxuutkncwscwsvl", model.value().get(0).filter().resourceGroups().get(0)); - Assertions.assertEquals("kvceoveilovnotyf", model.value().get(0).filter().osTypes().get(0)); - Assertions.assertEquals("dhbt", model.value().get(0).filter().locations().get(0)); - Assertions.assertEquals(TagOperators.ALL, model.value().get(0).filter().tagSettings().filterOperator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListConfigurationAssignmentsResult model = new ListConfigurationAssignmentsResult().withValue(Arrays.asList( - new ConfigurationAssignmentInner().withLocation("xpkd") - .withMaintenanceConfigurationId("aiuebbaumnyqu") - .withResourceId("deoj") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("khsmtxpsiebt", "hvpesapskrdqm", "jjdhtld")) - .withResourceGroups(Arrays.asList("zxuutkncwscwsvl", "otogtwrupqs", "vnm")) - .withOsTypes(Arrays.asList("kvceoveilovnotyf", "fcnj", "k")) - .withLocations(Arrays.asList("dhbt")) - .withTagSettings(new TagSettingsProperties().withTags(mapOf("ywpnvjt", Arrays.asList())) - .withFilterOperator(TagOperators.ALL))), - new ConfigurationAssignmentInner().withLocation("bjtazqugxywpmu") - .withMaintenanceConfigurationId("jzwf") - .withResourceId("q") - .withFilter(new ConfigurationAssignmentFilterProperties() - .withResourceTypes(Arrays.asList("suyonobglaocq", "tcc", "g")) - .withResourceGroups(Arrays.asList("xy")) - .withOsTypes(Arrays.asList("oyrxvwfudwpzntxh", "zhlrqjb", "ck", "rlhrxs")) - .withLocations(Arrays.asList("vpycanuzbp", "kafkuwbcrnwbm", "hhseyv", "us")) - .withTagSettings(new TagSettingsProperties() - .withTags(mapOf("hspkdeemao", Arrays.asList(), "mx", Arrays.asList())) - .withFilterOperator(TagOperators.ALL))))); - model = BinaryData.fromObject(model).toObject(ListConfigurationAssignmentsResult.class); - Assertions.assertEquals("xpkd", model.value().get(0).location()); - Assertions.assertEquals("aiuebbaumnyqu", model.value().get(0).maintenanceConfigurationId()); - Assertions.assertEquals("deoj", model.value().get(0).resourceId()); - Assertions.assertEquals("khsmtxpsiebt", model.value().get(0).filter().resourceTypes().get(0)); - Assertions.assertEquals("zxuutkncwscwsvl", model.value().get(0).filter().resourceGroups().get(0)); - Assertions.assertEquals("kvceoveilovnotyf", model.value().get(0).filter().osTypes().get(0)); - Assertions.assertEquals("dhbt", model.value().get(0).filter().locations().get(0)); - Assertions.assertEquals(TagOperators.ALL, model.value().get(0).filter().tagSettings().filterOperator()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListMaintenanceConfigurationsResultTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListMaintenanceConfigurationsResultTests.java deleted file mode 100644 index e6f88cf8a159..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListMaintenanceConfigurationsResultTests.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; -import com.azure.resourcemanager.maintenance.models.InputPatchConfiguration; -import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; -import com.azure.resourcemanager.maintenance.models.ListMaintenanceConfigurationsResult; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ListMaintenanceConfigurationsResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListMaintenanceConfigurationsResult model = BinaryData.fromString( - "{\"value\":[{\"location\":\"m\",\"tags\":{\"bejhphoycmsxa\":\"tzopbsphrupidgsy\"},\"properties\":{\"namespace\":\"dxbmtqioq\",\"extensionProperties\":{\"ownoizhw\":\"htbmuf\",\"jgkdmbpazlobcu\":\"rxybqsoq\"},\"maintenanceScope\":\"Host\",\"maintenanceWindow\":{\"startDateTime\":\"rbt\",\"expirationDateTime\":\"qjnqglhqgnufoooj\",\"duration\":\"ifsqesaagdfmg\",\"timeZone\":\"lhjxr\",\"recurEvery\":\"kwm\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"ocipaouajpsqucm\"],\"kbNumbersToInclude\":[\"fdkfogk\"],\"classificationsToInclude\":[\"jofjd\",\"eqsrdeupewnwreit\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"sarhmofc\",\"hs\",\"yurkdtmlxhekuksj\"],\"packageNameMasksToInclude\":[\"kc\",\"mparcryuanzw\",\"xzdxtayrlhmwh\",\"pmrqobm\"],\"classificationsToInclude\":[\"knryrtihfxtij\",\"pzvgnwzsymglzufc\",\"zk\"]}}},\"id\":\"dbihanufhfcbj\",\"name\":\"s\",\"type\":\"git\"},{\"location\":\"qhabifpikxwcz\",\"tags\":{\"rkxvdum\":\"cnpqxuhivyqniwby\",\"xgaudccs\":\"grtfwvu\",\"jcny\":\"h\"},\"properties\":{\"namespace\":\"kryhtnapczwlokj\",\"extensionProperties\":{\"jnchgej\":\"kkvnipjox\",\"huxinpmqnj\":\"podmailzydehojwy\"},\"maintenanceScope\":\"SQLManagedInstance\",\"maintenanceWindow\":{\"startDateTime\":\"jsprozvcpute\",\"expirationDateTime\":\"vwmf\",\"duration\":\"t\",\"timeZone\":\"mdvpjhulsu\",\"recurEvery\":\"mkjozkrwf\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"w\",\"jdpvwryo\"],\"kbNumbersToInclude\":[\"oacctaza\",\"ljlahbcryf\",\"dfdosygexp\"],\"classificationsToInclude\":[\"akhmsbzjhcrz\",\"vdphlxaolthqtr\",\"qjbpfzfsin\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"rwzoxxjtfelluwf\",\"it\"],\"packageNameMasksToInclude\":[\"eqfpj\",\"jlxofpdvhpfxxyp\",\"ninmayhuyb\"],\"classificationsToInclude\":[\"odepoogin\",\"vamih\"]}}},\"id\":\"gnarxzxtheo\",\"name\":\"usivye\",\"type\":\"cciqihnhungbwjz\"},{\"location\":\"fygxgispemvtzfk\",\"tags\":{\"aeqjhqjbasvms\":\"bljofxqeof\",\"gsntnbybkzgcwr\":\"jqul\",\"skcqvkocrcjd\":\"clxxwrljdo\"},\"properties\":{\"namespace\":\"nh\",\"extensionProperties\":{\"qpjwnzlljfm\":\"jbiksqrglssai\",\"vmgxsab\":\"pee\",\"jczdzevndh\":\"yqduujit\",\"feusnhut\":\"rwpdappdsbdkvwrw\"},\"maintenanceScope\":\"OSImage\",\"maintenanceWindow\":{\"startDateTime\":\"rl\",\"expirationDateTime\":\"ugjzzdatqxhocdge\",\"duration\":\"lgphu\",\"timeZone\":\"cndvkaozwyiftyhx\",\"recurEvery\":\"rokft\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"cukjf\",\"giawx\",\"lryplwckbasyy\",\"nddhsgcbacph\"],\"kbNumbersToInclude\":[\"ot\"],\"classificationsToInclude\":[\"gou\",\"zndlikwy\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"bmadgak\",\"qsrxybzqqed\",\"ytb\",\"iqfouflmmnkz\"],\"packageNameMasksToInclude\":[\"dmgloug\",\"b\"],\"classificationsToInclude\":[\"mutduqktaps\"]}}},\"id\":\"gcue\",\"name\":\"tumkdosvqwhbm\",\"type\":\"gbbjfddgmbmbe\"},{\"location\":\"pbhtqqrolfpfpsa\",\"tags\":{\"gjyjgzjaoyfhrtxi\":\"qux\",\"rkujy\":\"n\"},\"properties\":{\"namespace\":\"eju\",\"extensionProperties\":{\"jkcpr\":\"awrlyx\",\"nruj\":\"nwbxgjvtbvpyssz\",\"zw\":\"guhmuouqfpr\"},\"maintenanceScope\":\"Resource\",\"maintenanceWindow\":{\"startDateTime\":\"tnwu\",\"expirationDateTime\":\"gazxuf\",\"duration\":\"uckyf\",\"timeZone\":\"rfidfvzwdz\",\"recurEvery\":\"tymw\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"mnteiwao\",\"vkmijcmmxdcuf\",\"fsrpymzidnse\"],\"kbNumbersToInclude\":[\"tbzsgfyccs\",\"ewmdw\",\"jeiachboosfl\",\"ro\"],\"classificationsToInclude\":[\"pteehzzv\",\"pyqr\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"vswjdk\",\"rsoodqxhcrmnoh\",\"t\"],\"packageNameMasksToInclude\":[\"h\",\"soifiyipjxsqw\",\"gr\"],\"classificationsToInclude\":[\"norcjxvsnbyxqab\",\"mocpc\"]}}},\"id\":\"hurzafblj\",\"name\":\"gpbtoqcjmklj\",\"type\":\"vbqid\"}]}") - .toObject(ListMaintenanceConfigurationsResult.class); - Assertions.assertEquals("m", model.value().get(0).location()); - Assertions.assertEquals("tzopbsphrupidgsy", model.value().get(0).tags().get("bejhphoycmsxa")); - Assertions.assertEquals("dxbmtqioq", model.value().get(0).namespace()); - Assertions.assertEquals("htbmuf", model.value().get(0).extensionProperties().get("ownoizhw")); - Assertions.assertEquals(MaintenanceScope.HOST, model.value().get(0).maintenanceScope()); - Assertions.assertEquals(Visibility.PUBLIC, model.value().get(0).visibility()); - Assertions.assertEquals(RebootOptions.IF_REQUIRED, model.value().get(0).installPatches().rebootSetting()); - Assertions.assertEquals("ocipaouajpsqucm", - model.value().get(0).installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("fdkfogk", - model.value().get(0).installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("jofjd", - model.value().get(0).installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, - model.value().get(0).installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("sarhmofc", - model.value().get(0).installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("kc", - model.value().get(0).installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("knryrtihfxtij", - model.value().get(0).installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("rbt", model.value().get(0).startDateTime()); - Assertions.assertEquals("qjnqglhqgnufoooj", model.value().get(0).expirationDateTime()); - Assertions.assertEquals("ifsqesaagdfmg", model.value().get(0).duration()); - Assertions.assertEquals("lhjxr", model.value().get(0).timeZone()); - Assertions.assertEquals("kwm", model.value().get(0).recurEvery()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListMaintenanceConfigurationsResult model - = new ListMaintenanceConfigurationsResult() - .withValue( - Arrays - .asList( - new MaintenanceConfigurationInner().withLocation("m") - .withTags(mapOf("bejhphoycmsxa", "tzopbsphrupidgsy")) - .withNamespace("dxbmtqioq") - .withExtensionProperties(mapOf("ownoizhw", "htbmuf", "jgkdmbpazlobcu", "rxybqsoq")) - .withMaintenanceScope(MaintenanceScope.HOST) - .withVisibility(Visibility.PUBLIC) - .withInstallPatches(new InputPatchConfiguration() - .withRebootSetting(RebootOptions.IF_REQUIRED) - .withWindowsParameters(new InputWindowsParameters() - .withKbNumbersToExclude(Arrays.asList("ocipaouajpsqucm")) - .withKbNumbersToInclude(Arrays.asList("fdkfogk")) - .withClassificationsToInclude(Arrays.asList("jofjd", "eqsrdeupewnwreit")) - .withExcludeKbsRequiringReboot(true)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude( - Arrays.asList("sarhmofc", "hs", "yurkdtmlxhekuksj")) - .withPackageNameMasksToInclude( - Arrays.asList("kc", "mparcryuanzw", "xzdxtayrlhmwh", "pmrqobm")) - .withClassificationsToInclude( - Arrays.asList("knryrtihfxtij", "pzvgnwzsymglzufc", "zk")))) - .withStartDateTime("rbt") - .withExpirationDateTime("qjnqglhqgnufoooj") - .withDuration("ifsqesaagdfmg") - .withTimeZone("lhjxr") - .withRecurEvery("kwm"), - new MaintenanceConfigurationInner().withLocation("qhabifpikxwcz") - .withTags(mapOf("rkxvdum", "cnpqxuhivyqniwby", "xgaudccs", "grtfwvu", "jcny", "h")) - .withNamespace("kryhtnapczwlokj") - .withExtensionProperties( - mapOf("jnchgej", "kkvnipjox", "huxinpmqnj", "podmailzydehojwy")) - .withMaintenanceScope(MaintenanceScope.SQLMANAGED_INSTANCE) - .withVisibility(Visibility.CUSTOM) - .withInstallPatches(new InputPatchConfiguration().withRebootSetting(RebootOptions.NEVER) - .withWindowsParameters(new InputWindowsParameters() - .withKbNumbersToExclude(Arrays.asList("w", "jdpvwryo")) - .withKbNumbersToInclude(Arrays.asList("oacctaza", "ljlahbcryf", "dfdosygexp")) - .withClassificationsToInclude( - Arrays.asList("akhmsbzjhcrz", "vdphlxaolthqtr", "qjbpfzfsin")) - .withExcludeKbsRequiringReboot(false)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude(Arrays.asList("rwzoxxjtfelluwf", "it")) - .withPackageNameMasksToInclude( - Arrays.asList("eqfpj", "jlxofpdvhpfxxyp", "ninmayhuyb")) - .withClassificationsToInclude(Arrays.asList("odepoogin", "vamih")))) - .withStartDateTime("jsprozvcpute") - .withExpirationDateTime("vwmf") - .withDuration("t") - .withTimeZone("mdvpjhulsu") - .withRecurEvery("mkjozkrwf"), - new MaintenanceConfigurationInner().withLocation("fygxgispemvtzfk") - .withTags(mapOf("aeqjhqjbasvms", "bljofxqeof", "gsntnbybkzgcwr", "jqul", "skcqvkocrcjd", - "clxxwrljdo")) - .withNamespace("nh") - .withExtensionProperties(mapOf("qpjwnzlljfm", "jbiksqrglssai", "vmgxsab", "pee", - "jczdzevndh", "yqduujit", "feusnhut", "rwpdappdsbdkvwrw")) - .withMaintenanceScope(MaintenanceScope.OSIMAGE) - .withVisibility(Visibility.PUBLIC) - .withInstallPatches(new InputPatchConfiguration() - .withRebootSetting(RebootOptions.ALWAYS) - .withWindowsParameters(new InputWindowsParameters() - .withKbNumbersToExclude( - Arrays.asList("cukjf", "giawx", "lryplwckbasyy", "nddhsgcbacph")) - .withKbNumbersToInclude(Arrays.asList("ot")) - .withClassificationsToInclude(Arrays.asList("gou", "zndlikwy")) - .withExcludeKbsRequiringReboot(false)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude( - Arrays.asList("bmadgak", "qsrxybzqqed", "ytb", "iqfouflmmnkz")) - .withPackageNameMasksToInclude(Arrays.asList("dmgloug", "b")) - .withClassificationsToInclude(Arrays.asList("mutduqktaps")))) - .withStartDateTime("rl") - .withExpirationDateTime("ugjzzdatqxhocdge") - .withDuration("lgphu") - .withTimeZone("cndvkaozwyiftyhx") - .withRecurEvery("rokft"), - new MaintenanceConfigurationInner().withLocation("pbhtqqrolfpfpsa") - .withTags(mapOf("gjyjgzjaoyfhrtxi", "qux", "rkujy", "n")) - .withNamespace("eju") - .withExtensionProperties( - mapOf("jkcpr", "awrlyx", "nruj", "nwbxgjvtbvpyssz", "zw", "guhmuouqfpr")) - .withMaintenanceScope(MaintenanceScope.RESOURCE) - .withVisibility(Visibility.PUBLIC) - .withInstallPatches( - new InputPatchConfiguration().withRebootSetting(RebootOptions.ALWAYS) - .withWindowsParameters(new InputWindowsParameters() - .withKbNumbersToExclude( - Arrays.asList("mnteiwao", "vkmijcmmxdcuf", "fsrpymzidnse")) - .withKbNumbersToInclude( - Arrays.asList("tbzsgfyccs", "ewmdw", "jeiachboosfl", "ro")) - .withClassificationsToInclude(Arrays.asList("pteehzzv", "pyqr")) - .withExcludeKbsRequiringReboot(false)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude( - Arrays.asList("vswjdk", "rsoodqxhcrmnoh", "t")) - .withPackageNameMasksToInclude(Arrays.asList("h", "soifiyipjxsqw", "gr")) - .withClassificationsToInclude(Arrays.asList("norcjxvsnbyxqab", "mocpc")))) - .withStartDateTime("tnwu") - .withExpirationDateTime("gazxuf") - .withDuration("uckyf") - .withTimeZone("rfidfvzwdz") - .withRecurEvery("tymw"))); - model = BinaryData.fromObject(model).toObject(ListMaintenanceConfigurationsResult.class); - Assertions.assertEquals("m", model.value().get(0).location()); - Assertions.assertEquals("tzopbsphrupidgsy", model.value().get(0).tags().get("bejhphoycmsxa")); - Assertions.assertEquals("dxbmtqioq", model.value().get(0).namespace()); - Assertions.assertEquals("htbmuf", model.value().get(0).extensionProperties().get("ownoizhw")); - Assertions.assertEquals(MaintenanceScope.HOST, model.value().get(0).maintenanceScope()); - Assertions.assertEquals(Visibility.PUBLIC, model.value().get(0).visibility()); - Assertions.assertEquals(RebootOptions.IF_REQUIRED, model.value().get(0).installPatches().rebootSetting()); - Assertions.assertEquals("ocipaouajpsqucm", - model.value().get(0).installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("fdkfogk", - model.value().get(0).installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("jofjd", - model.value().get(0).installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, - model.value().get(0).installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("sarhmofc", - model.value().get(0).installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("kc", - model.value().get(0).installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("knryrtihfxtij", - model.value().get(0).installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("rbt", model.value().get(0).startDateTime()); - Assertions.assertEquals("qjnqglhqgnufoooj", model.value().get(0).expirationDateTime()); - Assertions.assertEquals("ifsqesaagdfmg", model.value().get(0).duration()); - Assertions.assertEquals("lhjxr", model.value().get(0).timeZone()); - Assertions.assertEquals("kwm", model.value().get(0).recurEvery()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListUpdatesResultTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListUpdatesResultTests.java deleted file mode 100644 index d03148c420ba..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ListUpdatesResultTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.UpdateInner; -import com.azure.resourcemanager.maintenance.models.ImpactType; -import com.azure.resourcemanager.maintenance.models.ListUpdatesResult; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.UpdateStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ListUpdatesResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListUpdatesResult model = BinaryData.fromString( - "{\"value\":[{\"maintenanceScope\":\"SQLManagedInstance\",\"impactType\":\"None\",\"status\":\"Pending\",\"impactDurationInSec\":1692678524,\"notBefore\":\"2021-02-13T03:31:18Z\",\"properties\":{\"resourceId\":\"rmcqiby\"}},{\"maintenanceScope\":\"Resource\",\"impactType\":\"None\",\"status\":\"Cancel\",\"impactDurationInSec\":8318309,\"notBefore\":\"2021-10-05T16:59:27Z\",\"properties\":{\"resourceId\":\"zvahapjy\"}},{\"maintenanceScope\":\"SQLDB\",\"impactType\":\"Freeze\",\"status\":\"Cancel\",\"impactDurationInSec\":141640204,\"notBefore\":\"2021-05-15T05:32:47Z\",\"properties\":{\"resourceId\":\"jzlmw\"}},{\"maintenanceScope\":\"Resource\",\"impactType\":\"None\",\"status\":\"Cancelled\",\"impactDurationInSec\":2083539395,\"notBefore\":\"2021-10-31T17:40:20Z\",\"properties\":{\"resourceId\":\"jvzunluthnnp\"}}]}") - .toObject(ListUpdatesResult.class); - Assertions.assertEquals(MaintenanceScope.SQLMANAGED_INSTANCE, model.value().get(0).maintenanceScope()); - Assertions.assertEquals(ImpactType.NONE, model.value().get(0).impactType()); - Assertions.assertEquals(UpdateStatus.PENDING, model.value().get(0).status()); - Assertions.assertEquals(1692678524, model.value().get(0).impactDurationInSec()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T03:31:18Z"), model.value().get(0).notBefore()); - Assertions.assertEquals("rmcqiby", model.value().get(0).resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListUpdatesResult model = new ListUpdatesResult().withValue(Arrays.asList( - new UpdateInner().withMaintenanceScope(MaintenanceScope.SQLMANAGED_INSTANCE) - .withImpactType(ImpactType.NONE) - .withStatus(UpdateStatus.PENDING) - .withImpactDurationInSec(1692678524) - .withNotBefore(OffsetDateTime.parse("2021-02-13T03:31:18Z")) - .withResourceId("rmcqiby"), - new UpdateInner().withMaintenanceScope(MaintenanceScope.RESOURCE) - .withImpactType(ImpactType.NONE) - .withStatus(UpdateStatus.CANCEL) - .withImpactDurationInSec(8318309) - .withNotBefore(OffsetDateTime.parse("2021-10-05T16:59:27Z")) - .withResourceId("zvahapjy"), - new UpdateInner().withMaintenanceScope(MaintenanceScope.SQLDB) - .withImpactType(ImpactType.FREEZE) - .withStatus(UpdateStatus.CANCEL) - .withImpactDurationInSec(141640204) - .withNotBefore(OffsetDateTime.parse("2021-05-15T05:32:47Z")) - .withResourceId("jzlmw"), - new UpdateInner().withMaintenanceScope(MaintenanceScope.RESOURCE) - .withImpactType(ImpactType.NONE) - .withStatus(UpdateStatus.CANCELLED) - .withImpactDurationInSec(2083539395) - .withNotBefore(OffsetDateTime.parse("2021-10-31T17:40:20Z")) - .withResourceId("jvzunluthnnp"))); - model = BinaryData.fromObject(model).toObject(ListUpdatesResult.class); - Assertions.assertEquals(MaintenanceScope.SQLMANAGED_INSTANCE, model.value().get(0).maintenanceScope()); - Assertions.assertEquals(ImpactType.NONE, model.value().get(0).impactType()); - Assertions.assertEquals(UpdateStatus.PENDING, model.value().get(0).status()); - Assertions.assertEquals(1692678524, model.value().get(0).impactDurationInSec()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-13T03:31:18Z"), model.value().get(0).notBefore()); - Assertions.assertEquals("rmcqiby", model.value().get(0).resourceId()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationInnerTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationInnerTests.java deleted file mode 100644 index bfb09cffcb39..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationInnerTests.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationInner; -import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; -import com.azure.resourcemanager.maintenance.models.InputPatchConfiguration; -import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceConfigurationInner model = BinaryData.fromString( - "{\"location\":\"ajzyul\",\"tags\":{\"rlkhbzhfepgzgq\":\"dj\"},\"properties\":{\"namespace\":\"locx\",\"extensionProperties\":{\"sglumma\":\"aierhhb\",\"xkqpxo\":\"tjaodxobnb\"},\"maintenanceScope\":\"Resource\",\"maintenanceWindow\":{\"startDateTime\":\"npime\",\"expirationDateTime\":\"stxgc\",\"duration\":\"dg\",\"timeZone\":\"ajrmvdjwzrlovmc\",\"recurEvery\":\"hijco\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"qsycbkbfkgu\"],\"kbNumbersToInclude\":[\"exxppofmxaxcfjp\",\"ddtocjjxhvp\"],\"classificationsToInclude\":[\"exhd\",\"xibqeojnx\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"ntwndeicbtwnpzao\",\"vuhrhcffcyddgl\",\"jthjqkwpyei\"],\"packageNameMasksToInclude\":[\"qciwqvhkhixuigdt\"],\"classificationsToInclude\":[\"objoghmewu\"]}}},\"id\":\"a\",\"name\":\"hrzayvvtpgvdf\",\"type\":\"iotkftutqxl\"}") - .toObject(MaintenanceConfigurationInner.class); - Assertions.assertEquals("ajzyul", model.location()); - Assertions.assertEquals("dj", model.tags().get("rlkhbzhfepgzgq")); - Assertions.assertEquals("locx", model.namespace()); - Assertions.assertEquals("aierhhb", model.extensionProperties().get("sglumma")); - Assertions.assertEquals(MaintenanceScope.RESOURCE, model.maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, model.visibility()); - Assertions.assertEquals(RebootOptions.NEVER, model.installPatches().rebootSetting()); - Assertions.assertEquals("qsycbkbfkgu", model.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("exxppofmxaxcfjp", - model.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("exhd", model.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, model.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("ntwndeicbtwnpzao", - model.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("qciwqvhkhixuigdt", - model.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("objoghmewu", - model.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("npime", model.startDateTime()); - Assertions.assertEquals("stxgc", model.expirationDateTime()); - Assertions.assertEquals("dg", model.duration()); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.timeZone()); - Assertions.assertEquals("hijco", model.recurEvery()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceConfigurationInner model = new MaintenanceConfigurationInner().withLocation("ajzyul") - .withTags(mapOf("rlkhbzhfepgzgq", "dj")) - .withNamespace("locx") - .withExtensionProperties(mapOf("sglumma", "aierhhb", "xkqpxo", "tjaodxobnb")) - .withMaintenanceScope(MaintenanceScope.RESOURCE) - .withVisibility(Visibility.CUSTOM) - .withInstallPatches(new InputPatchConfiguration().withRebootSetting(RebootOptions.NEVER) - .withWindowsParameters(new InputWindowsParameters().withKbNumbersToExclude(Arrays.asList("qsycbkbfkgu")) - .withKbNumbersToInclude(Arrays.asList("exxppofmxaxcfjp", "ddtocjjxhvp")) - .withClassificationsToInclude(Arrays.asList("exhd", "xibqeojnx")) - .withExcludeKbsRequiringReboot(true)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude(Arrays.asList("ntwndeicbtwnpzao", "vuhrhcffcyddgl", "jthjqkwpyei")) - .withPackageNameMasksToInclude(Arrays.asList("qciwqvhkhixuigdt")) - .withClassificationsToInclude(Arrays.asList("objoghmewu")))) - .withStartDateTime("npime") - .withExpirationDateTime("stxgc") - .withDuration("dg") - .withTimeZone("ajrmvdjwzrlovmc") - .withRecurEvery("hijco"); - model = BinaryData.fromObject(model).toObject(MaintenanceConfigurationInner.class); - Assertions.assertEquals("ajzyul", model.location()); - Assertions.assertEquals("dj", model.tags().get("rlkhbzhfepgzgq")); - Assertions.assertEquals("locx", model.namespace()); - Assertions.assertEquals("aierhhb", model.extensionProperties().get("sglumma")); - Assertions.assertEquals(MaintenanceScope.RESOURCE, model.maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, model.visibility()); - Assertions.assertEquals(RebootOptions.NEVER, model.installPatches().rebootSetting()); - Assertions.assertEquals("qsycbkbfkgu", model.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("exxppofmxaxcfjp", - model.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("exhd", model.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, model.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("ntwndeicbtwnpzao", - model.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("qciwqvhkhixuigdt", - model.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("objoghmewu", - model.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("npime", model.startDateTime()); - Assertions.assertEquals("stxgc", model.expirationDateTime()); - Assertions.assertEquals("dg", model.duration()); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.timeZone()); - Assertions.assertEquals("hijco", model.recurEvery()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..e426c30c82d1 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; +import com.azure.resourcemanager.maintenance.models.InputPatchConfiguration; +import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.RebootOptions; +import com.azure.resourcemanager.maintenance.models.Visibility; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationOperationGroupsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"namespace\":\"kwqqtchealmf\",\"extensionProperties\":{\"v\":\"aayg\"},\"maintenanceScope\":\"SQLDB\",\"maintenanceWindow\":{\"startDateTime\":\"ohgwxrtfudxepxg\",\"expirationDateTime\":\"agvrvmnpkuk\",\"duration\":\"i\",\"timeZone\":\"blxgwimf\",\"recurEvery\":\"hfjx\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"rey\",\"kzikfjawneaivxwc\"],\"kbNumbersToInclude\":[\"pcirelsfeaen\",\"abfatkl\",\"dxbjhwuaanozj\"],\"classificationsToInclude\":[\"hyoulpjr\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"vimjwos\",\"tx\",\"tcs\",\"fcktqumiekke\"],\"packageNameMasksToInclude\":[\"khly\"],\"classificationsToInclude\":[\"dgqggebdu\",\"ygaeqidbqfatpxl\"]}}},\"location\":\"xcyjmoadsuvarmy\",\"tags\":{\"rw\":\"jsjqbjhhyx\",\"duhpk\":\"yc\"},\"id\":\"kgymareqnajxqug\",\"name\":\"hky\",\"type\":\"ubeddg\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MaintenanceConfiguration response = manager.maintenanceConfigurationOperationGroups() + .define("hykojoxafnndlpic") + .withRegion("mqg") + .withExistingResourceGroup("dbutauvfbtkuwhh") + .withTags(mapOf("zikywgg", "u", "uipiccjzk", "kallatmel")) + .withNamespace("ymkcdyhb") + .withExtensionProperties(mapOf("vljxywsu", "pwdreqnovvqf")) + .withMaintenanceScope(MaintenanceScope.OSIMAGE) + .withVisibility(Visibility.CUSTOM) + .withInstallPatches(new InputPatchConfiguration().withRebootSetting(RebootOptions.NEVER) + .withWindowsParameters(new InputWindowsParameters() + .withKbNumbersToExclude(Arrays.asList("hqkvpuvksgplsak", "ynfs", "n", "jphuopxodlqi")) + .withKbNumbersToInclude(Arrays.asList("orzihle", "sjswsrms")) + .withClassificationsToInclude(Arrays.asList("rpzbchckqqzqi", "xiy")) + .withExcludeKbsRequiringReboot(true)) + .withLinuxParameters(new InputLinuxParameters() + .withPackageNameMasksToExclude( + Arrays.asList("nkedyatrwyhqmib", "yhwitsmypyynpcdp", "mnzgmwznmabi", "nsorgjhxbldt")) + .withPackageNameMasksToInclude(Arrays.asList("rlkdmtncvokotl", "xdy")) + .withClassificationsToInclude(Arrays.asList("y", "cogjltdtbn", "hadoocrk", "cikhnv")))) + .withStartDateTime("ndsytgadg") + .withExpirationDateTime("aeaeneqnzarrw") + .withDuration("uu") + .withTimeZone("fqka") + .withRecurEvery("wiipfpub") + .create(); + + Assertions.assertEquals("xcyjmoadsuvarmy", response.location()); + Assertions.assertEquals("jsjqbjhhyx", response.tags().get("rw")); + Assertions.assertEquals("kwqqtchealmf", response.namespace()); + Assertions.assertEquals("aayg", response.extensionProperties().get("v")); + Assertions.assertEquals(MaintenanceScope.SQLDB, response.maintenanceScope()); + Assertions.assertEquals(Visibility.PUBLIC, response.visibility()); + Assertions.assertEquals(RebootOptions.NEVER, response.installPatches().rebootSetting()); + Assertions.assertEquals("rey", response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); + Assertions.assertEquals("pcirelsfeaen", + response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); + Assertions.assertEquals("hyoulpjr", + response.installPatches().windowsParameters().classificationsToInclude().get(0)); + Assertions.assertFalse(response.installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("vimjwos", + response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); + Assertions.assertEquals("khly", response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); + Assertions.assertEquals("dgqggebdu", + response.installPatches().linuxParameters().classificationsToInclude().get(0)); + Assertions.assertEquals("ohgwxrtfudxepxg", response.startDateTime()); + Assertions.assertEquals("agvrvmnpkuk", response.expirationDateTime()); + Assertions.assertEquals("i", response.duration()); + Assertions.assertEquals("blxgwimf", response.timeZone()); + Assertions.assertEquals("hfjx", response.recurEvery()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsDeleteByResourceGroupWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..a7444a84d5da --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.RebootOptions; +import com.azure.resourcemanager.maintenance.models.Visibility; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationOperationGroupsDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"namespace\":\"wptfdy\",\"extensionProperties\":{\"huaoppp\":\"qbuaceopzfqr\",\"z\":\"qeqxo\",\"moizpos\":\"ahzxctobgbk\"},\"maintenanceScope\":\"Resource\",\"maintenanceWindow\":{\"startDateTime\":\"fbunrmfqjhhk\",\"expirationDateTime\":\"pvjymjhxxjyng\",\"duration\":\"ivkrtsw\",\"timeZone\":\"qzvszjf\",\"recurEvery\":\"vjfdx\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"aqtdoqmcbx\",\"wvxysl\",\"bhsfxob\",\"ytkblmpew\"],\"kbNumbersToInclude\":[\"bkrvrnsvshqj\",\"hxcr\",\"bfovasrruvwbhsq\"],\"classificationsToInclude\":[\"bcgjbirxbp\",\"bsrfbj\",\"dtws\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"vjz\",\"exilzznfqqnvwpmq\"],\"packageNameMasksToInclude\":[\"uoujmkcjhwqy\",\"jrybnwjewgdrjer\"],\"classificationsToInclude\":[\"enq\"]}}},\"location\":\"hin\",\"tags\":{\"dslgnayqigynduh\":\"gmifthnzd\"},\"id\":\"vhqlkthumaqo\",\"name\":\"bgycduiertgccym\",\"type\":\"aolps\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MaintenanceConfiguration response = manager.maintenanceConfigurationOperationGroups() + .deleteByResourceGroupWithResponse("zhxgktrmgucn", "pkteo", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("hin", response.location()); + Assertions.assertEquals("gmifthnzd", response.tags().get("dslgnayqigynduh")); + Assertions.assertEquals("wptfdy", response.namespace()); + Assertions.assertEquals("qbuaceopzfqr", response.extensionProperties().get("huaoppp")); + Assertions.assertEquals(MaintenanceScope.RESOURCE, response.maintenanceScope()); + Assertions.assertEquals(Visibility.CUSTOM, response.visibility()); + Assertions.assertEquals(RebootOptions.IF_REQUIRED, response.installPatches().rebootSetting()); + Assertions.assertEquals("aqtdoqmcbx", + response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); + Assertions.assertEquals("bkrvrnsvshqj", + response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); + Assertions.assertEquals("bcgjbirxbp", + response.installPatches().windowsParameters().classificationsToInclude().get(0)); + Assertions.assertFalse(response.installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("vjz", response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); + Assertions.assertEquals("uoujmkcjhwqy", + response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); + Assertions.assertEquals("enq", response.installPatches().linuxParameters().classificationsToInclude().get(0)); + Assertions.assertEquals("fbunrmfqjhhk", response.startDateTime()); + Assertions.assertEquals("pvjymjhxxjyng", response.expirationDateTime()); + Assertions.assertEquals("ivkrtsw", response.duration()); + Assertions.assertEquals("qzvszjf", response.timeZone()); + Assertions.assertEquals("vjfdx", response.recurEvery()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsGetByResourceGroupWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..24b27fc8ca1c --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.RebootOptions; +import com.azure.resourcemanager.maintenance.models.Visibility; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationOperationGroupsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"namespace\":\"mkh\",\"extensionProperties\":{\"lrbpbewtghfgbl\":\"bbcswsrtjri\"},\"maintenanceScope\":\"OSImage\",\"maintenanceWindow\":{\"startDateTime\":\"vlvqhjkbegi\",\"expirationDateTime\":\"nmxiebwwaloayqc\",\"duration\":\"rtzju\",\"timeZone\":\"wyzmhtxon\",\"recurEvery\":\"ts\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"p\",\"rknftguvriuhprwm\",\"yvxqtayriwwroy\",\"bexrmcq\"],\"kbNumbersToInclude\":[\"cnojvknmefqsg\",\"vah\",\"pjyzhpv\",\"qzcjrvxdj\"],\"classificationsToInclude\":[\"wlxkvugfhzovaw\",\"vzunluthnnprnxi\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"zuaejxd\",\"ltskzbbtd\",\"umveekgpwozuhkf\",\"bsjyofdx\"],\"packageNameMasksToInclude\":[\"sd\"],\"classificationsToInclude\":[\"uwaboekqvke\",\"nsmvbxwyj\",\"flhhcaal\",\"jixisxyawjoyaqcs\"]}}},\"location\":\"jpkiidzyexznelix\",\"tags\":{\"alaulppggdtpnapn\":\"ztfolhbnxk\"},\"id\":\"iropuhpigvpgylg\",\"name\":\"git\",\"type\":\"medjvcslynqwwncw\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MaintenanceConfiguration response = manager.maintenanceConfigurationOperationGroups() + .getByResourceGroupWithResponse("nbmpowuwprzq", "veual", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("jpkiidzyexznelix", response.location()); + Assertions.assertEquals("ztfolhbnxk", response.tags().get("alaulppggdtpnapn")); + Assertions.assertEquals("mkh", response.namespace()); + Assertions.assertEquals("bbcswsrtjri", response.extensionProperties().get("lrbpbewtghfgbl")); + Assertions.assertEquals(MaintenanceScope.OSIMAGE, response.maintenanceScope()); + Assertions.assertEquals(Visibility.PUBLIC, response.visibility()); + Assertions.assertEquals(RebootOptions.NEVER, response.installPatches().rebootSetting()); + Assertions.assertEquals("p", response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); + Assertions.assertEquals("cnojvknmefqsg", + response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); + Assertions.assertEquals("wlxkvugfhzovaw", + response.installPatches().windowsParameters().classificationsToInclude().get(0)); + Assertions.assertTrue(response.installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("zuaejxd", + response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); + Assertions.assertEquals("sd", response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); + Assertions.assertEquals("uwaboekqvke", + response.installPatches().linuxParameters().classificationsToInclude().get(0)); + Assertions.assertEquals("vlvqhjkbegi", response.startDateTime()); + Assertions.assertEquals("nmxiebwwaloayqc", response.expirationDateTime()); + Assertions.assertEquals("rtzju", response.duration()); + Assertions.assertEquals("wyzmhtxon", response.timeZone()); + Assertions.assertEquals("ts", response.recurEvery()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsListByResourceGroupMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..758e5030778e --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsListByResourceGroupMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.RebootOptions; +import com.azure.resourcemanager.maintenance.models.Visibility; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationOperationGroupsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"namespace\":\"bbglzpswiydmc\",\"extensionProperties\":{\"dbzm\":\"zdxss\",\"cblylpstdbhhxsr\":\"vdfznudaodvxzb\",\"erscdntne\":\"dzu\"},\"maintenanceScope\":\"InGuestPatch\",\"maintenanceWindow\":{\"startDateTime\":\"mygtdssls\",\"expirationDateTime\":\"mweriofzpy\",\"duration\":\"emwabnet\",\"timeZone\":\"hszhedplvwiwu\",\"recurEvery\":\"wmbesldnkw\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"ogaok\",\"nzmnsikvm\",\"qzeqqkdltfzxm\",\"hvhgureod\"],\"kbNumbersToInclude\":[\"bdagxt\",\"bqdxbx\",\"akbogqxndlkzgxh\",\"ripl\"],\"classificationsToInclude\":[\"dxunkbebxmubyyn\",\"wlrbqtkoievseo\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"tmuwlauwzi\",\"xbmp\",\"cjefuzmu\",\"pbttdum\"],\"packageNameMasksToInclude\":[\"pxebmnzbt\"],\"classificationsToInclude\":[\"pglkf\",\"ohdneuel\",\"phsdyhto\"]}}},\"location\":\"ikdowwquuvx\",\"tags\":{\"hcohfwdsjnk\":\"lvithhqzonosgg\",\"swacffgdkzz\":\"ljuti\"},\"id\":\"wkfvhqcrailvp\",\"name\":\"ppfufl\",\"type\":\"wdmhdlxyjrxs\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.maintenanceConfigurationOperationGroups() + .listByResourceGroup("lqlfm", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ikdowwquuvx", response.iterator().next().location()); + Assertions.assertEquals("lvithhqzonosgg", response.iterator().next().tags().get("hcohfwdsjnk")); + Assertions.assertEquals("bbglzpswiydmc", response.iterator().next().namespace()); + Assertions.assertEquals("zdxss", response.iterator().next().extensionProperties().get("dbzm")); + Assertions.assertEquals(MaintenanceScope.IN_GUEST_PATCH, response.iterator().next().maintenanceScope()); + Assertions.assertEquals(Visibility.CUSTOM, response.iterator().next().visibility()); + Assertions.assertEquals(RebootOptions.ALWAYS, response.iterator().next().installPatches().rebootSetting()); + Assertions.assertEquals("ogaok", + response.iterator().next().installPatches().windowsParameters().kbNumbersToExclude().get(0)); + Assertions.assertEquals("bdagxt", + response.iterator().next().installPatches().windowsParameters().kbNumbersToInclude().get(0)); + Assertions.assertEquals("dxunkbebxmubyyn", + response.iterator().next().installPatches().windowsParameters().classificationsToInclude().get(0)); + Assertions + .assertFalse(response.iterator().next().installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("tmuwlauwzi", + response.iterator().next().installPatches().linuxParameters().packageNameMasksToExclude().get(0)); + Assertions.assertEquals("pxebmnzbt", + response.iterator().next().installPatches().linuxParameters().packageNameMasksToInclude().get(0)); + Assertions.assertEquals("pglkf", + response.iterator().next().installPatches().linuxParameters().classificationsToInclude().get(0)); + Assertions.assertEquals("mygtdssls", response.iterator().next().startDateTime()); + Assertions.assertEquals("mweriofzpy", response.iterator().next().expirationDateTime()); + Assertions.assertEquals("emwabnet", response.iterator().next().duration()); + Assertions.assertEquals("hszhedplvwiwu", response.iterator().next().timeZone()); + Assertions.assertEquals("wmbesldnkw", response.iterator().next().recurEvery()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsListMockTests.java new file mode 100644 index 000000000000..53fe1495256e --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationOperationGroupsListMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.RebootOptions; +import com.azure.resourcemanager.maintenance.models.Visibility; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationOperationGroupsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"namespace\":\"fcnihgwq\",\"extensionProperties\":{\"pkeqdcvdrhvoo\":\"edgfbcvkcvq\",\"dopcjwvnh\":\"sotbob\"},\"maintenanceScope\":\"Host\",\"maintenanceWindow\":{\"startDateTime\":\"gx\",\"expirationDateTime\":\"rslpmutwuoeg\",\"duration\":\"khjwn\",\"timeZone\":\"qsluicp\",\"recurEvery\":\"gk\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"xmodf\",\"uefywsbpfvmwy\",\"rfouyftaakcpw\"],\"kbNumbersToInclude\":[\"vqtmnub\",\"xkp\",\"ksmond\"],\"classificationsToInclude\":[\"uxvypomgkopkwh\",\"jvp\",\"jqg\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"mbqfqvmk\",\"xozap\",\"helxprglya\"],\"packageNameMasksToInclude\":[\"ckcb\",\"uejrjxgc\"],\"classificationsToInclude\":[\"brh\",\"sxsdqrhzoymibm\",\"qyib\"]}}},\"location\":\"wfluszdt\",\"tags\":{\"cpi\":\"kwofyyvoq\",\"nwashrtd\":\"xpbtgiwbwo\",\"ulpiuj\":\"kcnqxwbpo\"},\"id\":\"aasipqi\",\"name\":\"obyu\",\"type\":\"erpqlpqwcciuqg\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.maintenanceConfigurationOperationGroups().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wfluszdt", response.iterator().next().location()); + Assertions.assertEquals("kwofyyvoq", response.iterator().next().tags().get("cpi")); + Assertions.assertEquals("fcnihgwq", response.iterator().next().namespace()); + Assertions.assertEquals("edgfbcvkcvq", response.iterator().next().extensionProperties().get("pkeqdcvdrhvoo")); + Assertions.assertEquals(MaintenanceScope.HOST, response.iterator().next().maintenanceScope()); + Assertions.assertEquals(Visibility.PUBLIC, response.iterator().next().visibility()); + Assertions.assertEquals(RebootOptions.IF_REQUIRED, response.iterator().next().installPatches().rebootSetting()); + Assertions.assertEquals("xmodf", + response.iterator().next().installPatches().windowsParameters().kbNumbersToExclude().get(0)); + Assertions.assertEquals("vqtmnub", + response.iterator().next().installPatches().windowsParameters().kbNumbersToInclude().get(0)); + Assertions.assertEquals("uxvypomgkopkwh", + response.iterator().next().installPatches().windowsParameters().classificationsToInclude().get(0)); + Assertions + .assertFalse(response.iterator().next().installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("mbqfqvmk", + response.iterator().next().installPatches().linuxParameters().packageNameMasksToExclude().get(0)); + Assertions.assertEquals("ckcb", + response.iterator().next().installPatches().linuxParameters().packageNameMasksToInclude().get(0)); + Assertions.assertEquals("brh", + response.iterator().next().installPatches().linuxParameters().classificationsToInclude().get(0)); + Assertions.assertEquals("gx", response.iterator().next().startDateTime()); + Assertions.assertEquals("rslpmutwuoeg", response.iterator().next().expirationDateTime()); + Assertions.assertEquals("khjwn", response.iterator().next().duration()); + Assertions.assertEquals("qsluicp", response.iterator().next().timeZone()); + Assertions.assertEquals("gk", response.iterator().next().recurEvery()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationPropertiesTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationPropertiesTests.java deleted file mode 100644 index 5dbd9ba49fa6..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationPropertiesTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceConfigurationProperties; -import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; -import com.azure.resourcemanager.maintenance.models.InputPatchConfiguration; -import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceConfigurationProperties model = BinaryData.fromString( - "{\"namespace\":\"xlefgugnxkrx\",\"extensionProperties\":{\"tthzrvqd\":\"i\"},\"maintenanceScope\":\"InGuestPatch\",\"maintenanceWindow\":{\"startDateTime\":\"yb\",\"expirationDateTime\":\"ehoqfbowskan\",\"duration\":\"tzlcuiywgqywgn\",\"timeZone\":\"vynhzgpphrcg\",\"recurEvery\":\"cocpecfvmmcoofsx\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"qabcypm\",\"vkwlzuvccfwnf\",\"bacfionlebxetq\",\"tzxdpnqbqqwx\"],\"kbNumbersToInclude\":[\"eallnwsubisnj\",\"mpmngnzscxaqwoo\",\"hcbonqvpkvlr\"],\"classificationsToInclude\":[\"ea\",\"eipheoflokeyy\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"lwtgrhpdj\",\"jumasx\",\"zj\"],\"packageNameMasksToInclude\":[\"e\"],\"classificationsToInclude\":[\"lhbxxhejjzzvdud\",\"wdslfhotwmcy\"]}}}") - .toObject(MaintenanceConfigurationProperties.class); - Assertions.assertEquals("xlefgugnxkrx", model.namespace()); - Assertions.assertEquals("i", model.extensionProperties().get("tthzrvqd")); - Assertions.assertEquals(MaintenanceScope.IN_GUEST_PATCH, model.maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, model.visibility()); - Assertions.assertEquals(RebootOptions.IF_REQUIRED, model.installPatches().rebootSetting()); - Assertions.assertEquals("qabcypm", model.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("eallnwsubisnj", - model.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("ea", model.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(false, model.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("lwtgrhpdj", - model.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("e", model.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("lhbxxhejjzzvdud", - model.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("yb", model.startDateTime()); - Assertions.assertEquals("ehoqfbowskan", model.expirationDateTime()); - Assertions.assertEquals("tzlcuiywgqywgn", model.duration()); - Assertions.assertEquals("vynhzgpphrcg", model.timeZone()); - Assertions.assertEquals("cocpecfvmmcoofsx", model.recurEvery()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceConfigurationProperties model = new MaintenanceConfigurationProperties() - .withNamespace("xlefgugnxkrx") - .withExtensionProperties(mapOf("tthzrvqd", "i")) - .withMaintenanceScope(MaintenanceScope.IN_GUEST_PATCH) - .withVisibility(Visibility.CUSTOM) - .withInstallPatches(new InputPatchConfiguration().withRebootSetting(RebootOptions.IF_REQUIRED) - .withWindowsParameters(new InputWindowsParameters() - .withKbNumbersToExclude(Arrays.asList("qabcypm", "vkwlzuvccfwnf", "bacfionlebxetq", "tzxdpnqbqqwx")) - .withKbNumbersToInclude(Arrays.asList("eallnwsubisnj", "mpmngnzscxaqwoo", "hcbonqvpkvlr")) - .withClassificationsToInclude(Arrays.asList("ea", "eipheoflokeyy")) - .withExcludeKbsRequiringReboot(false)) - .withLinuxParameters( - new InputLinuxParameters().withPackageNameMasksToExclude(Arrays.asList("lwtgrhpdj", "jumasx", "zj")) - .withPackageNameMasksToInclude(Arrays.asList("e")) - .withClassificationsToInclude(Arrays.asList("lhbxxhejjzzvdud", "wdslfhotwmcy")))) - .withStartDateTime("yb") - .withExpirationDateTime("ehoqfbowskan") - .withDuration("tzlcuiywgqywgn") - .withTimeZone("vynhzgpphrcg") - .withRecurEvery("cocpecfvmmcoofsx"); - model = BinaryData.fromObject(model).toObject(MaintenanceConfigurationProperties.class); - Assertions.assertEquals("xlefgugnxkrx", model.namespace()); - Assertions.assertEquals("i", model.extensionProperties().get("tthzrvqd")); - Assertions.assertEquals(MaintenanceScope.IN_GUEST_PATCH, model.maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, model.visibility()); - Assertions.assertEquals(RebootOptions.IF_REQUIRED, model.installPatches().rebootSetting()); - Assertions.assertEquals("qabcypm", model.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("eallnwsubisnj", - model.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("ea", model.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(false, model.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("lwtgrhpdj", - model.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("e", model.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("lhbxxhejjzzvdud", - model.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("yb", model.startDateTime()); - Assertions.assertEquals("ehoqfbowskan", model.expirationDateTime()); - Assertions.assertEquals("tzlcuiywgqywgn", model.duration()); - Assertions.assertEquals("vynhzgpphrcg", model.timeZone()); - Assertions.assertEquals("cocpecfvmmcoofsx", model.recurEvery()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 295b70d1e9ce..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.InputLinuxParameters; -import com.azure.resourcemanager.maintenance.models.InputPatchConfiguration; -import com.azure.resourcemanager.maintenance.models.InputWindowsParameters; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenanceConfigurationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"location\":\"vwrdnhfukuvsj\",\"tags\":{\"lerchpq\":\"smystuluqypfc\",\"dfc\":\"mfpjbabw\",\"qddrihpfhoqcaae\":\"sspuunnoxyhkx\",\"djvlpj\":\"dao\"},\"properties\":{\"namespace\":\"zb\",\"extensionProperties\":{\"xonbzoggculapz\":\"geivsiykzkdncj\",\"pgogtqxepny\":\"y\"},\"maintenanceScope\":\"SQLManagedInstance\",\"maintenanceWindow\":{\"startDateTime\":\"jlyjtlvofq\",\"expirationDateTime\":\"vfcibyfmowux\",\"duration\":\"jpvd\",\"timeZone\":\"fzwiivwzjbhyz\",\"recurEvery\":\"jrkambtrnegvmnv\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"astjbkkdmflvestm\"],\"kbNumbersToInclude\":[\"rriloz\",\"peewchpxlkt\",\"kuziycsle\"],\"classificationsToInclude\":[\"uztcktyhjtqed\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"mmrqz\",\"rr\"],\"packageNameMasksToInclude\":[\"gl\",\"dzgkr\"],\"classificationsToInclude\":[\"ev\"]}}},\"id\":\"epr\",\"name\":\"utnwytpzdmovzvf\",\"type\":\"aawzqadfl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MaintenanceConfiguration response = manager.maintenanceConfigurations() - .define("gyavu") - .withExistingResourceGroup("zdvoqytibyowbb") - .withRegion("thjoxoism") - .withTags(mapOf("sffgcvizqzd", "bpimlqoljxkcgxxl", "w", "l")) - .withNamespace("upfgfbk") - .withExtensionProperties(mapOf("wzf", "dyhgkfminsg", "ctxtgzukxi", "tsttktlahbq", "xrxc", "mmqtgqqqxhr", - "azivjlfrqttbajl", "juisavokqdzf")) - .withMaintenanceScope(MaintenanceScope.IN_GUEST_PATCH) - .withVisibility(Visibility.PUBLIC) - .withInstallPatches(new InputPatchConfiguration().withRebootSetting(RebootOptions.ALWAYS) - .withWindowsParameters( - new InputWindowsParameters().withKbNumbersToExclude(Arrays.asList("vvjgslor", "il", "yw", "t")) - .withKbNumbersToInclude(Arrays.asList("xnyed")) - .withClassificationsToInclude(Arrays.asList("yvudtjuewbci", "xuuwhcj", "xccybvpa")) - .withExcludeKbsRequiringReboot(false)) - .withLinuxParameters(new InputLinuxParameters() - .withPackageNameMasksToExclude(Arrays.asList("zp", "gwjplmag", "tcyohpfkyrk")) - .withPackageNameMasksToInclude(Arrays.asList("giogsjkmnwqjno")) - .withClassificationsToInclude(Arrays.asList("yhddvia", "egfnmntfpmvmemfn")))) - .withStartDateTime("xyiopidkqqfku") - .withExpirationDateTime("cxkdmligovi") - .withDuration("xk") - .withTimeZone("loazuruocbgoo") - .withRecurEvery("te") - .create(); - - Assertions.assertEquals("vwrdnhfukuvsj", response.location()); - Assertions.assertEquals("smystuluqypfc", response.tags().get("lerchpq")); - Assertions.assertEquals("zb", response.namespace()); - Assertions.assertEquals("geivsiykzkdncj", response.extensionProperties().get("xonbzoggculapz")); - Assertions.assertEquals(MaintenanceScope.SQLMANAGED_INSTANCE, response.maintenanceScope()); - Assertions.assertEquals(Visibility.PUBLIC, response.visibility()); - Assertions.assertEquals(RebootOptions.ALWAYS, response.installPatches().rebootSetting()); - Assertions.assertEquals("astjbkkdmflvestm", - response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("rriloz", response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("uztcktyhjtqed", - response.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, response.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("mmrqz", - response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("gl", response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("ev", response.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("jlyjtlvofq", response.startDateTime()); - Assertions.assertEquals("vfcibyfmowux", response.expirationDateTime()); - Assertions.assertEquals("jpvd", response.duration()); - Assertions.assertEquals("fzwiivwzjbhyz", response.timeZone()); - Assertions.assertEquals("jrkambtrnegvmnv", response.recurEvery()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 60745719580e..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenanceConfigurationsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr - = "{\"location\":\"eqphchqnrnr\",\"tags\":{\"iklbydvkhb\":\"huwrykqgaifm\",\"xcv\":\"jdz\",\"v\":\"srhnjivo\",\"jdftuljltd\":\"novqfzge\"},\"properties\":{\"namespace\":\"amtmcz\",\"extensionProperties\":{\"ssxmojms\":\"ejwcwwqiok\"},\"maintenanceScope\":\"InGuestPatch\",\"maintenanceWindow\":{\"startDateTime\":\"rvkwc\",\"expirationDateTime\":\"ql\",\"duration\":\"x\",\"timeZone\":\"czheyd\",\"recurEvery\":\"dshmkxmaehvbbx\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"tbaxk\"],\"kbNumbersToInclude\":[\"wrck\",\"yklyhpluodpvruud\"],\"classificationsToInclude\":[\"ibthostgktstvd\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"dqbcvhzlhplod\",\"kdl\"],\"packageNameMasksToInclude\":[\"fbumlkx\",\"rqjfsmlm\",\"txhwgfws\",\"tawc\"],\"classificationsToInclude\":[\"brhu\",\"skh\",\"dyg\",\"ookk\"]}}},\"id\":\"qjbvleorfmlu\",\"name\":\"qtqzfavyv\",\"type\":\"qqybarye\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MaintenanceConfiguration response = manager.maintenanceConfigurations() - .deleteByResourceGroupWithResponse("jslb", "wkojgcyztsfmzn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eqphchqnrnr", response.location()); - Assertions.assertEquals("huwrykqgaifm", response.tags().get("iklbydvkhb")); - Assertions.assertEquals("amtmcz", response.namespace()); - Assertions.assertEquals("ejwcwwqiok", response.extensionProperties().get("ssxmojms")); - Assertions.assertEquals(MaintenanceScope.IN_GUEST_PATCH, response.maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, response.visibility()); - Assertions.assertEquals(RebootOptions.NEVER, response.installPatches().rebootSetting()); - Assertions.assertEquals("tbaxk", response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("wrck", response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("ibthostgktstvd", - response.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, response.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("dqbcvhzlhplod", - response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("fbumlkx", - response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("brhu", response.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("rvkwc", response.startDateTime()); - Assertions.assertEquals("ql", response.expirationDateTime()); - Assertions.assertEquals("x", response.duration()); - Assertions.assertEquals("czheyd", response.timeZone()); - Assertions.assertEquals("dshmkxmaehvbbx", response.recurEvery()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsForResourceGroupsListByResourceGroupMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsForResourceGroupsListByResourceGroupMockTests.java deleted file mode 100644 index 9054358c5820..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsForResourceGroupsListByResourceGroupMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenanceConfigurationsForResourceGroupsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"iglaecx\",\"tags\":{\"mlqtmldgxob\":\"icokpv\"},\"properties\":{\"namespace\":\"clnpkci\",\"extensionProperties\":{\"vkjlmxhom\":\"riykhyawfvjlbox\",\"nraauzz\":\"ynhdwdigum\"},\"maintenanceScope\":\"InGuestPatch\",\"maintenanceWindow\":{\"startDateTime\":\"ysdzhez\",\"expirationDateTime\":\"vaiqyuvvf\",\"duration\":\"kphhq\",\"timeZone\":\"kvylauyavl\",\"recurEvery\":\"mncsttijfybvp\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"dhuzqgnjdgk\"],\"kbNumbersToInclude\":[\"cli\",\"hzvhxnkomtkubo\"],\"classificationsToInclude\":[\"nvdxzxhihfrbbc\",\"vqagtltdhlf\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"kvgtrdcn\",\"fmzzsdymbrny\",\"u\",\"m\"],\"packageNameMasksToInclude\":[\"fwgckhocxvdfffw\"],\"classificationsToInclude\":[\"roud\",\"spave\"]}}},\"id\":\"r\",\"name\":\"kbunzoz\",\"type\":\"dhcxgkmoy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.maintenanceConfigurationsForResourceGroups() - .listByResourceGroup("z", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("iglaecx", response.iterator().next().location()); - Assertions.assertEquals("icokpv", response.iterator().next().tags().get("mlqtmldgxob")); - Assertions.assertEquals("clnpkci", response.iterator().next().namespace()); - Assertions.assertEquals("riykhyawfvjlbox", response.iterator().next().extensionProperties().get("vkjlmxhom")); - Assertions.assertEquals(MaintenanceScope.IN_GUEST_PATCH, response.iterator().next().maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, response.iterator().next().visibility()); - Assertions.assertEquals(RebootOptions.ALWAYS, response.iterator().next().installPatches().rebootSetting()); - Assertions.assertEquals("dhuzqgnjdgk", - response.iterator().next().installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("cli", - response.iterator().next().installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("nvdxzxhihfrbbc", - response.iterator().next().installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, - response.iterator().next().installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("kvgtrdcn", - response.iterator().next().installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("fwgckhocxvdfffw", - response.iterator().next().installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("roud", - response.iterator().next().installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("ysdzhez", response.iterator().next().startDateTime()); - Assertions.assertEquals("vaiqyuvvf", response.iterator().next().expirationDateTime()); - Assertions.assertEquals("kphhq", response.iterator().next().duration()); - Assertions.assertEquals("kvylauyavl", response.iterator().next().timeZone()); - Assertions.assertEquals("mncsttijfybvp", response.iterator().next().recurEvery()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetByResourceGroupWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 832e9f1db3e8..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class MaintenanceConfigurationsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"location\":\"dsofbshrns\",\"tags\":{\"jsrtk\":\"swdvzyybycnun\",\"uxzejntpsew\":\"awnopqgikyzirtxd\"},\"properties\":{\"namespace\":\"ilqu\",\"extensionProperties\":{\"ggufhyaomtb\":\"dxtqmieoxo\",\"pjbi\":\"hhavgrvkffovjz\"},\"maintenanceScope\":\"Resource\",\"maintenanceWindow\":{\"startDateTime\":\"xumvfcluyovw\",\"expirationDateTime\":\"bkfezzxscyhwzdgi\",\"duration\":\"jbzbomvzzbtdcq\",\"timeZone\":\"niyujv\",\"recurEvery\":\"l\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Never\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"bgye\",\"rymsgaojfmw\"],\"kbNumbersToInclude\":[\"tmr\",\"hirctymoxoftpipi\"],\"classificationsToInclude\":[\"zuhx\",\"cpqjlihhyu\",\"pskasdvlmfwdg\",\"x\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"amrsreuzv\",\"urisjnhnytxifqj\"],\"packageNameMasksToInclude\":[\"mrhublwpc\",\"sutrgjup\"],\"classificationsToInclude\":[\"tpwoqhihejq\",\"w\",\"pnfqntcyp\",\"xjvfoimwksl\"]}}},\"id\":\"cizjxvydfceacvl\",\"name\":\"vygdyft\",\"type\":\"mrtwna\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MaintenanceConfiguration response = manager.maintenanceConfigurations() - .getByResourceGroupWithResponse("jbdhqxvc", "gf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dsofbshrns", response.location()); - Assertions.assertEquals("swdvzyybycnun", response.tags().get("jsrtk")); - Assertions.assertEquals("ilqu", response.namespace()); - Assertions.assertEquals("dxtqmieoxo", response.extensionProperties().get("ggufhyaomtb")); - Assertions.assertEquals(MaintenanceScope.RESOURCE, response.maintenanceScope()); - Assertions.assertEquals(Visibility.PUBLIC, response.visibility()); - Assertions.assertEquals(RebootOptions.NEVER, response.installPatches().rebootSetting()); - Assertions.assertEquals("bgye", response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("tmr", response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("zuhx", - response.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(false, response.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("amrsreuzv", - response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("mrhublwpc", - response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("tpwoqhihejq", - response.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("xumvfcluyovw", response.startDateTime()); - Assertions.assertEquals("bkfezzxscyhwzdgi", response.expirationDateTime()); - Assertions.assertEquals("jbzbomvzzbtdcq", response.duration()); - Assertions.assertEquals("niyujv", response.timeZone()); - Assertions.assertEquals("l", response.recurEvery()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..03be8d47ac4f --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsGetWithResponseMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.maintenance.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.maintenance.MaintenanceManager; +import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; +import com.azure.resourcemanager.maintenance.models.MaintenanceScope; +import com.azure.resourcemanager.maintenance.models.RebootOptions; +import com.azure.resourcemanager.maintenance.models.Visibility; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MaintenanceConfigurationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"namespace\":\"wd\",\"extensionProperties\":{\"dbpgnxytxhp\":\"zt\"},\"maintenanceScope\":\"Resource\",\"maintenanceWindow\":{\"startDateTime\":\"fzab\",\"expirationDateTime\":\"cuh\",\"duration\":\"tcty\",\"timeZone\":\"klbb\",\"recurEvery\":\"plwzbhvgyugu\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"qukkfp\"],\"kbNumbersToInclude\":[\"gsxnkjzkdeslpv\"],\"classificationsToInclude\":[\"wiyighxpkdw\",\"baiuebbaumny\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"ojnabckhsmtxpsie\",\"tfhvpesapskrdqmh\"],\"packageNameMasksToInclude\":[\"htldwk\",\"zxuutkncwscwsvl\",\"otogtwrupqs\"],\"classificationsToInclude\":[\"micykvceoveilo\"]}}},\"location\":\"oty\",\"tags\":{\"kphywpnvjto\":\"cnjbkcnxdhbt\"},\"id\":\"nermcl\",\"name\":\"plpho\",\"type\":\"uscrpabgyepsb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + MaintenanceManager manager = MaintenanceManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + MaintenanceConfiguration response = manager.maintenanceConfigurations() + .getWithResponse("cuxrhdwbavx", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("oty", response.location()); + Assertions.assertEquals("cnjbkcnxdhbt", response.tags().get("kphywpnvjto")); + Assertions.assertEquals("wd", response.namespace()); + Assertions.assertEquals("zt", response.extensionProperties().get("dbpgnxytxhp")); + Assertions.assertEquals(MaintenanceScope.RESOURCE, response.maintenanceScope()); + Assertions.assertEquals(Visibility.PUBLIC, response.visibility()); + Assertions.assertEquals(RebootOptions.IF_REQUIRED, response.installPatches().rebootSetting()); + Assertions.assertEquals("qukkfp", response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); + Assertions.assertEquals("gsxnkjzkdeslpv", + response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); + Assertions.assertEquals("wiyighxpkdw", + response.installPatches().windowsParameters().classificationsToInclude().get(0)); + Assertions.assertFalse(response.installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("ojnabckhsmtxpsie", + response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); + Assertions.assertEquals("htldwk", + response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); + Assertions.assertEquals("micykvceoveilo", + response.installPatches().linuxParameters().classificationsToInclude().get(0)); + Assertions.assertEquals("fzab", response.startDateTime()); + Assertions.assertEquals("cuh", response.expirationDateTime()); + Assertions.assertEquals("tcty", response.duration()); + Assertions.assertEquals("klbb", response.timeZone()); + Assertions.assertEquals("plwzbhvgyugu", response.recurEvery()); + } +} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListMockTests.java index d523a3fdb610..c0c6e79f238d 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceConfigurationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; @@ -25,44 +25,44 @@ public final class MaintenanceConfigurationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"yjkqabqgzslesjcb\",\"tags\":{\"tiewdj\":\"n\",\"ehwagoh\":\"vbquwr\",\"xtdr\":\"uffkmrqemvvh\"},\"properties\":{\"namespace\":\"tac\",\"extensionProperties\":{\"guaadraufactkahz\":\"jvewzcjznmwcp\"},\"maintenanceScope\":\"InGuestPatch\",\"maintenanceWindow\":{\"startDateTime\":\"ziuxxpshnee\",\"expirationDateTime\":\"lfg\",\"duration\":\"qubkw\",\"timeZone\":\"enr\",\"recurEvery\":\"utujba\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"yfln\",\"rwm\"],\"kbNumbersToInclude\":[\"wpklvxw\",\"ygdxpgpqchis\",\"epn\",\"bjcrxgibbdaxco\"],\"classificationsToInclude\":[\"zauorsuk\",\"kwbqplhlvnuu\",\"pzlrphw\",\"soldweyuqdunv\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"biorktal\",\"wjhhgdnhxmsivf\"],\"packageNameMasksToInclude\":[\"loxggdufiqn\",\"ieuzaofjchvcyyy\",\"fgdo\"],\"classificationsToInclude\":[\"biipuip\",\"oqonma\",\"jeknizshq\",\"cimpevfg\"]}}},\"id\":\"lrri\",\"name\":\"bywdxsmicc\",\"type\":\"rwfscjfnynszquj\"}]}"; + = "{\"value\":[{\"properties\":{\"namespace\":\"zq\",\"extensionProperties\":{\"jidsuyonobglaoc\":\"ywpmueefjzwfqkq\",\"udxytlmoyrx\":\"xtccmg\",\"qj\":\"wfudwpzntxhdzhl\",\"bkyvp\":\"hckfrlhrx\"},\"maintenanceScope\":\"Host\",\"maintenanceWindow\":{\"startDateTime\":\"z\",\"expirationDateTime\":\"zka\",\"duration\":\"uwbc\",\"timeZone\":\"wbme\",\"recurEvery\":\"seyvj\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"kdeemaofmxagkvtm\",\"lmqkrhahvlj\",\"ahaquh\",\"dhmdua\"],\"kbNumbersToInclude\":[\"xqpvfadmw\"],\"classificationsToInclude\":[\"r\",\"vxpvgomz\",\"fmisg\"],\"excludeKbsRequiringReboot\":false},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"ldawkzbaliourqha\"],\"packageNameMasksToInclude\":[\"hashsfwxosow\",\"xcug\",\"cjooxdjebwpucwwf\"],\"classificationsToInclude\":[\"bvmeuecivy\",\"zceuojgjrw\"]}}},\"location\":\"eiotwmcdytdx\",\"tags\":{\"wgqwgxhn\":\"xnrj\",\"y\":\"skxfbk\"},\"id\":\"gklwn\",\"name\":\"nhjdauw\",\"type\":\"vylwzbtdhxuj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.maintenanceConfigurations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("yjkqabqgzslesjcb", response.iterator().next().location()); - Assertions.assertEquals("n", response.iterator().next().tags().get("tiewdj")); - Assertions.assertEquals("tac", response.iterator().next().namespace()); - Assertions.assertEquals("jvewzcjznmwcp", - response.iterator().next().extensionProperties().get("guaadraufactkahz")); - Assertions.assertEquals(MaintenanceScope.IN_GUEST_PATCH, response.iterator().next().maintenanceScope()); - Assertions.assertEquals(Visibility.PUBLIC, response.iterator().next().visibility()); - Assertions.assertEquals(RebootOptions.ALWAYS, response.iterator().next().installPatches().rebootSetting()); - Assertions.assertEquals("yfln", + Assertions.assertEquals("eiotwmcdytdx", response.iterator().next().location()); + Assertions.assertEquals("xnrj", response.iterator().next().tags().get("wgqwgxhn")); + Assertions.assertEquals("zq", response.iterator().next().namespace()); + Assertions.assertEquals("ywpmueefjzwfqkq", + response.iterator().next().extensionProperties().get("jidsuyonobglaoc")); + Assertions.assertEquals(MaintenanceScope.HOST, response.iterator().next().maintenanceScope()); + Assertions.assertEquals(Visibility.CUSTOM, response.iterator().next().visibility()); + Assertions.assertEquals(RebootOptions.IF_REQUIRED, response.iterator().next().installPatches().rebootSetting()); + Assertions.assertEquals("kdeemaofmxagkvtm", response.iterator().next().installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("wpklvxw", + Assertions.assertEquals("xqpvfadmw", response.iterator().next().installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("zauorsuk", + Assertions.assertEquals("r", response.iterator().next().installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, - response.iterator().next().installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("biorktal", + Assertions + .assertFalse(response.iterator().next().installPatches().windowsParameters().excludeKbsRequiringReboot()); + Assertions.assertEquals("ldawkzbaliourqha", response.iterator().next().installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("loxggdufiqn", + Assertions.assertEquals("hashsfwxosow", response.iterator().next().installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("biipuip", + Assertions.assertEquals("bvmeuecivy", response.iterator().next().installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("ziuxxpshnee", response.iterator().next().startDateTime()); - Assertions.assertEquals("lfg", response.iterator().next().expirationDateTime()); - Assertions.assertEquals("qubkw", response.iterator().next().duration()); - Assertions.assertEquals("enr", response.iterator().next().timeZone()); - Assertions.assertEquals("utujba", response.iterator().next().recurEvery()); + Assertions.assertEquals("z", response.iterator().next().startDateTime()); + Assertions.assertEquals("zka", response.iterator().next().expirationDateTime()); + Assertions.assertEquals("uwbc", response.iterator().next().duration()); + Assertions.assertEquals("wbme", response.iterator().next().timeZone()); + Assertions.assertEquals("seyvj", response.iterator().next().recurEvery()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceWindowTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceWindowTests.java deleted file mode 100644 index 6bd419d7f2a8..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/MaintenanceWindowTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.MaintenanceWindow; -import org.junit.jupiter.api.Assertions; - -public final class MaintenanceWindowTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MaintenanceWindow model = BinaryData.fromString( - "{\"startDateTime\":\"wlbjnpgacftade\",\"expirationDateTime\":\"nltyfsoppusuesnz\",\"duration\":\"ej\",\"timeZone\":\"vorxzdmohct\",\"recurEvery\":\"vudwx\"}") - .toObject(MaintenanceWindow.class); - Assertions.assertEquals("wlbjnpgacftade", model.startDateTime()); - Assertions.assertEquals("nltyfsoppusuesnz", model.expirationDateTime()); - Assertions.assertEquals("ej", model.duration()); - Assertions.assertEquals("vorxzdmohct", model.timeZone()); - Assertions.assertEquals("vudwx", model.recurEvery()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MaintenanceWindow model = new MaintenanceWindow().withStartDateTime("wlbjnpgacftade") - .withExpirationDateTime("nltyfsoppusuesnz") - .withDuration("ej") - .withTimeZone("vorxzdmohct") - .withRecurEvery("vudwx"); - model = BinaryData.fromObject(model).toObject(MaintenanceWindow.class); - Assertions.assertEquals("wlbjnpgacftade", model.startDateTime()); - Assertions.assertEquals("nltyfsoppusuesnz", model.expirationDateTime()); - Assertions.assertEquals("ej", model.duration()); - Assertions.assertEquals("vorxzdmohct", model.timeZone()); - Assertions.assertEquals("vudwx", model.recurEvery()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationInfoTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationInfoTests.java deleted file mode 100644 index 17615fa1e559..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationInfoTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.models.OperationInfo; -import org.junit.jupiter.api.Assertions; - -public final class OperationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInfo model = BinaryData.fromString( - "{\"provider\":\"zmh\",\"resource\":\"ongmtsa\",\"operation\":\"cbpwxqpsrknft\",\"description\":\"vriuhprwmdyvx\"}") - .toObject(OperationInfo.class); - Assertions.assertEquals("zmh", model.provider()); - Assertions.assertEquals("ongmtsa", model.resource()); - Assertions.assertEquals("cbpwxqpsrknft", model.operation()); - Assertions.assertEquals("vriuhprwmdyvx", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInfo model = new OperationInfo().withProvider("zmh") - .withResource("ongmtsa") - .withOperation("cbpwxqpsrknft") - .withDescription("vriuhprwmdyvx"); - model = BinaryData.fromObject(model).toObject(OperationInfo.class); - Assertions.assertEquals("zmh", model.provider()); - Assertions.assertEquals("ongmtsa", model.resource()); - Assertions.assertEquals("cbpwxqpsrknft", model.operation()); - Assertions.assertEquals("vriuhprwmdyvx", model.description()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationInnerTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationInnerTests.java deleted file mode 100644 index b4ce68c8603f..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.OperationInner; -import com.azure.resourcemanager.maintenance.models.OperationInfo; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"eualupjmkhf\",\"display\":{\"provider\":\"bcswsrt\",\"resource\":\"iplrbpbewtghfgb\",\"operation\":\"gw\",\"description\":\"vlvqhjkbegi\"},\"origin\":\"nmxiebwwaloayqc\",\"properties\":\"datartzju\",\"isDataAction\":true}") - .toObject(OperationInner.class); - Assertions.assertEquals("eualupjmkhf", model.name()); - Assertions.assertEquals("bcswsrt", model.display().provider()); - Assertions.assertEquals("iplrbpbewtghfgb", model.display().resource()); - Assertions.assertEquals("gw", model.display().operation()); - Assertions.assertEquals("vlvqhjkbegi", model.display().description()); - Assertions.assertEquals("nmxiebwwaloayqc", model.origin()); - Assertions.assertEquals(true, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("eualupjmkhf") - .withDisplay(new OperationInfo().withProvider("bcswsrt") - .withResource("iplrbpbewtghfgb") - .withOperation("gw") - .withDescription("vlvqhjkbegi")) - .withOrigin("nmxiebwwaloayqc") - .withProperties("datartzju") - .withIsDataAction(true); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("eualupjmkhf", model.name()); - Assertions.assertEquals("bcswsrt", model.display().provider()); - Assertions.assertEquals("iplrbpbewtghfgb", model.display().resource()); - Assertions.assertEquals("gw", model.display().operation()); - Assertions.assertEquals("vlvqhjkbegi", model.display().description()); - Assertions.assertEquals("nmxiebwwaloayqc", model.origin()); - Assertions.assertEquals(true, model.isDataAction()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListMockTests.java index 4df001b82c8d..1487956c1861 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListMockTests.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.Operation; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -22,23 +21,16 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"bp\",\"display\":{\"provider\":\"f\",\"resource\":\"kvntjlrigjkskyri\",\"operation\":\"vzidsxwaab\",\"description\":\"ifrygzn\"},\"origin\":\"axri\",\"properties\":\"datazob\",\"isDataAction\":false}]}"; + = "{\"value\":[{\"name\":\"zt\",\"isDataAction\":false,\"display\":{\"provider\":\"rq\",\"resource\":\"edckzywbiexzfey\",\"operation\":\"axibxujw\",\"description\":\"qwalmuzyoxaepd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("bp", response.iterator().next().name()); - Assertions.assertEquals("f", response.iterator().next().display().provider()); - Assertions.assertEquals("kvntjlrigjkskyri", response.iterator().next().display().resource()); - Assertions.assertEquals("vzidsxwaab", response.iterator().next().display().operation()); - Assertions.assertEquals("ifrygzn", response.iterator().next().display().description()); - Assertions.assertEquals("axri", response.iterator().next().origin()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListResultTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListResultTests.java deleted file mode 100644 index 258c5a706cc7..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/OperationsListResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.OperationInner; -import com.azure.resourcemanager.maintenance.models.OperationInfo; -import com.azure.resourcemanager.maintenance.models.OperationsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"beldawkzbaliourq\",\"display\":{\"provider\":\"auhashsfwx\",\"resource\":\"owzxcu\",\"operation\":\"cjooxdjebwpucwwf\",\"description\":\"vbvmeu\"},\"origin\":\"ivyhzceuojgjrwju\",\"properties\":\"dataotwmcdyt\",\"isDataAction\":false},{\"name\":\"txnrjaw\",\"display\":{\"provider\":\"gxhnisk\",\"resource\":\"bkpyc\",\"operation\":\"lwn\",\"description\":\"hjdauwhvylwz\"},\"origin\":\"dhxujznbmpo\",\"properties\":\"datawpr\",\"isDataAction\":false}]}") - .toObject(OperationsListResult.class); - Assertions.assertEquals("beldawkzbaliourq", model.value().get(0).name()); - Assertions.assertEquals("auhashsfwx", model.value().get(0).display().provider()); - Assertions.assertEquals("owzxcu", model.value().get(0).display().resource()); - Assertions.assertEquals("cjooxdjebwpucwwf", model.value().get(0).display().operation()); - Assertions.assertEquals("vbvmeu", model.value().get(0).display().description()); - Assertions.assertEquals("ivyhzceuojgjrwju", model.value().get(0).origin()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsListResult model = new OperationsListResult().withValue(Arrays.asList( - new OperationInner().withName("beldawkzbaliourq") - .withDisplay(new OperationInfo().withProvider("auhashsfwx") - .withResource("owzxcu") - .withOperation("cjooxdjebwpucwwf") - .withDescription("vbvmeu")) - .withOrigin("ivyhzceuojgjrwju") - .withProperties("dataotwmcdyt") - .withIsDataAction(false), - new OperationInner().withName("txnrjaw") - .withDisplay(new OperationInfo().withProvider("gxhnisk") - .withResource("bkpyc") - .withOperation("lwn") - .withDescription("hjdauwhvylwz")) - .withOrigin("dhxujznbmpo") - .withProperties("datawpr") - .withIsDataAction(false))); - model = BinaryData.fromObject(model).toObject(OperationsListResult.class); - Assertions.assertEquals("beldawkzbaliourq", model.value().get(0).name()); - Assertions.assertEquals("auhashsfwx", model.value().get(0).display().provider()); - Assertions.assertEquals("owzxcu", model.value().get(0).display().resource()); - Assertions.assertEquals("cjooxdjebwpucwwf", model.value().get(0).display().operation()); - Assertions.assertEquals("vbvmeu", model.value().get(0).display().description()); - Assertions.assertEquals("ivyhzceuojgjrwju", model.value().get(0).origin()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsGetWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index a8224d6ee6b7..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PublicMaintenanceConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"aruoujmkcjhwqyt\",\"tags\":{\"ewgdrjervn\":\"bnw\"},\"properties\":{\"namespace\":\"qp\",\"extensionProperties\":{\"l\":\"ndoygmifthnzdnd\",\"ynduha\":\"nayqi\",\"bgycduiertgccym\":\"hqlkthumaqo\",\"lqlfm\":\"aolps\"},\"maintenanceScope\":\"Extension\",\"maintenanceWindow\":{\"startDateTime\":\"glzpswiydm\",\"expirationDateTime\":\"yhz\",\"duration\":\"ss\",\"timeZone\":\"bzmnvdfznud\",\"recurEvery\":\"dvxzbncblylpst\"},\"visibility\":\"Custom\",\"installPatches\":{\"rebootSetting\":\"Always\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"zucerscdntnev\"],\"kbNumbersToInclude\":[\"jmygtdsslswtmwer\"],\"classificationsToInclude\":[\"zpyqsemwab\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"szhedplvw\",\"wubmwmbesldn\",\"wwtppj\",\"lcxog\"],\"packageNameMasksToInclude\":[\"onz\",\"nsikvmkqzeqqkdl\",\"fzxmhhvhgureodkw\"],\"classificationsToInclude\":[\"agxti\",\"qdxbxwa\",\"bogqxndlkzgxhu\"]}}},\"id\":\"plbpodxun\",\"name\":\"bebxmubyyntwl\",\"type\":\"bqtkoievseotgqr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MaintenanceConfiguration response = manager.publicMaintenanceConfigurations() - .getWithResponse("vwpm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("aruoujmkcjhwqyt", response.location()); - Assertions.assertEquals("bnw", response.tags().get("ewgdrjervn")); - Assertions.assertEquals("qp", response.namespace()); - Assertions.assertEquals("ndoygmifthnzdnd", response.extensionProperties().get("l")); - Assertions.assertEquals(MaintenanceScope.EXTENSION, response.maintenanceScope()); - Assertions.assertEquals(Visibility.CUSTOM, response.visibility()); - Assertions.assertEquals(RebootOptions.ALWAYS, response.installPatches().rebootSetting()); - Assertions.assertEquals("zucerscdntnev", - response.installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("jmygtdsslswtmwer", - response.installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("zpyqsemwab", - response.installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, response.installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("szhedplvw", - response.installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("onz", response.installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("agxti", response.installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("glzpswiydm", response.startDateTime()); - Assertions.assertEquals("yhz", response.expirationDateTime()); - Assertions.assertEquals("ss", response.duration()); - Assertions.assertEquals("bzmnvdfznud", response.timeZone()); - Assertions.assertEquals("dvxzbncblylpst", response.recurEvery()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsListMockTests.java deleted file mode 100644 index ff194834512e..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/PublicMaintenanceConfigurationsListMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.maintenance.MaintenanceManager; -import com.azure.resourcemanager.maintenance.models.MaintenanceConfiguration; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.RebootOptions; -import com.azure.resourcemanager.maintenance.models.Visibility; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PublicMaintenanceConfigurationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"vbxwyjsflhh\",\"tags\":{\"joya\":\"lnjixisxya\"},\"properties\":{\"namespace\":\"lyjpk\",\"extensionProperties\":{\"lixhnrztfol\":\"zyexzn\",\"dtpnapnyiropuhp\":\"bnxknalaulppg\",\"gqgitxmedjvcsl\":\"gvpgy\"},\"maintenanceScope\":\"SQLDB\",\"maintenanceWindow\":{\"startDateTime\":\"ncw\",\"expirationDateTime\":\"hxg\",\"duration\":\"rmgucnap\",\"timeZone\":\"eoellwptfdygp\",\"recurEvery\":\"b\"},\"visibility\":\"Public\",\"installPatches\":{\"rebootSetting\":\"IfRequired\",\"windowsParameters\":{\"kbNumbersToExclude\":[\"rhhuaopppcqeqx\",\"lzdahzxctobgbkdm\"],\"kbNumbersToInclude\":[\"postmgrcfbunrm\",\"qjhhkxbpv\",\"ymjhxxjyngudivkr\"],\"classificationsToInclude\":[\"bxqz\",\"szjfauvjfdxxivet\",\"t\"],\"excludeKbsRequiringReboot\":true},\"linuxParameters\":{\"packageNameMasksToExclude\":[\"oqmcbxvwvxyslq\",\"hsfxoblytkb\",\"mpew\",\"wfbkrvrns\"],\"packageNameMasksToInclude\":[\"q\",\"ohxcrsbfova\",\"rruvwbhsq\",\"sub\"],\"classificationsToInclude\":[\"birx\"]}}},\"id\":\"ybsrfbjfdtwss\",\"name\":\"t\",\"type\":\"tpvjzbexilzznfqq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - MaintenanceManager manager = MaintenanceManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.publicMaintenanceConfigurations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vbxwyjsflhh", response.iterator().next().location()); - Assertions.assertEquals("lnjixisxya", response.iterator().next().tags().get("joya")); - Assertions.assertEquals("lyjpk", response.iterator().next().namespace()); - Assertions.assertEquals("zyexzn", response.iterator().next().extensionProperties().get("lixhnrztfol")); - Assertions.assertEquals(MaintenanceScope.SQLDB, response.iterator().next().maintenanceScope()); - Assertions.assertEquals(Visibility.PUBLIC, response.iterator().next().visibility()); - Assertions.assertEquals(RebootOptions.IF_REQUIRED, response.iterator().next().installPatches().rebootSetting()); - Assertions.assertEquals("rhhuaopppcqeqx", - response.iterator().next().installPatches().windowsParameters().kbNumbersToExclude().get(0)); - Assertions.assertEquals("postmgrcfbunrm", - response.iterator().next().installPatches().windowsParameters().kbNumbersToInclude().get(0)); - Assertions.assertEquals("bxqz", - response.iterator().next().installPatches().windowsParameters().classificationsToInclude().get(0)); - Assertions.assertEquals(true, - response.iterator().next().installPatches().windowsParameters().excludeKbsRequiringReboot()); - Assertions.assertEquals("oqmcbxvwvxyslq", - response.iterator().next().installPatches().linuxParameters().packageNameMasksToExclude().get(0)); - Assertions.assertEquals("q", - response.iterator().next().installPatches().linuxParameters().packageNameMasksToInclude().get(0)); - Assertions.assertEquals("birx", - response.iterator().next().installPatches().linuxParameters().classificationsToInclude().get(0)); - Assertions.assertEquals("ncw", response.iterator().next().startDateTime()); - Assertions.assertEquals("hxg", response.iterator().next().expirationDateTime()); - Assertions.assertEquals("rmgucnap", response.iterator().next().duration()); - Assertions.assertEquals("eoellwptfdygp", response.iterator().next().timeZone()); - Assertions.assertEquals("b", response.iterator().next().recurEvery()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventApproveResponseInnerTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventApproveResponseInnerTests.java deleted file mode 100644 index 6b3473f70cf7..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventApproveResponseInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.ScheduledEventApproveResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class ScheduledEventApproveResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScheduledEventApproveResponseInner model - = BinaryData.fromString("{\"value\":\"mhquvgjxp\"}").toObject(ScheduledEventApproveResponseInner.class); - Assertions.assertEquals("mhquvgjxp", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScheduledEventApproveResponseInner model = new ScheduledEventApproveResponseInner().withValue("mhquvgjxp"); - model = BinaryData.fromObject(model).toObject(ScheduledEventApproveResponseInner.class); - Assertions.assertEquals("mhquvgjxp", model.value()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventsAcknowledgeWithResponseMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventOperationGroupsAcknowledgeWithResponseMockTests.java similarity index 70% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventsAcknowledgeWithResponseMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventOperationGroupsAcknowledgeWithResponseMockTests.java index 3a92c8074b6b..483377cc2fb2 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventsAcknowledgeWithResponseMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/ScheduledEventOperationGroupsAcknowledgeWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ScheduledEventApproveResponse; @@ -17,23 +17,22 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ScheduledEventsAcknowledgeWithResponseMockTests { +public final class ScheduledEventOperationGroupsAcknowledgeWithResponseMockTests { @Test public void testAcknowledgeWithResponse() throws Exception { - String responseStr = "{\"value\":\"ekqvkeln\"}"; + String responseStr = "{\"value\":\"wmqtibx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ScheduledEventApproveResponse response = manager.scheduledEvents() - .acknowledgeWithResponse("btdzumveekg", "wozuhkf", "bsjyofdx", "uusdttouwa", - com.azure.core.util.Context.NONE) + ScheduledEventApproveResponse response = manager.scheduledEventOperationGroups() + .acknowledgeWithResponse("thwtzol", "a", "mwmdxmebwjscjpa", "lxveabfqx", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ekqvkeln", response.value()); + Assertions.assertEquals("wmqtibx", response.value()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/TagSettingsPropertiesTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/TagSettingsPropertiesTests.java deleted file mode 100644 index 85a9f9a5505f..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/TagSettingsPropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.models.TagOperators; -import com.azure.resourcemanager.maintenance.models.TagSettingsProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagSettingsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagSettingsProperties model = BinaryData - .fromString( - "{\"tags\":{\"slpvlop\":[\"u\",\"uosvmkfssxqukk\",\"plgmgsxnk\",\"zkd\"]},\"filterOperator\":\"All\"}") - .toObject(TagSettingsProperties.class); - Assertions.assertEquals("u", model.tags().get("slpvlop").get(0)); - Assertions.assertEquals(TagOperators.ALL, model.filterOperator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagSettingsProperties model = new TagSettingsProperties() - .withTags(mapOf("slpvlop", Arrays.asList("u", "uosvmkfssxqukk", "plgmgsxnk", "zkd"))) - .withFilterOperator(TagOperators.ALL); - model = BinaryData.fromObject(model).toObject(TagSettingsProperties.class); - Assertions.assertEquals("u", model.tags().get("slpvlop").get(0)); - Assertions.assertEquals(TagOperators.ALL, model.filterOperator()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdateInnerTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdateInnerTests.java deleted file mode 100644 index d03f55b6e828..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdateInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.UpdateInner; -import com.azure.resourcemanager.maintenance.models.ImpactType; -import com.azure.resourcemanager.maintenance.models.MaintenanceScope; -import com.azure.resourcemanager.maintenance.models.UpdateStatus; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class UpdateInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateInner model = BinaryData.fromString( - "{\"maintenanceScope\":\"SQLDB\",\"impactType\":\"Redeploy\",\"status\":\"Cancel\",\"impactDurationInSec\":1073043267,\"notBefore\":\"2021-07-12T01:35:59Z\",\"properties\":{\"resourceId\":\"e\"}}") - .toObject(UpdateInner.class); - Assertions.assertEquals(MaintenanceScope.SQLDB, model.maintenanceScope()); - Assertions.assertEquals(ImpactType.REDEPLOY, model.impactType()); - Assertions.assertEquals(UpdateStatus.CANCEL, model.status()); - Assertions.assertEquals(1073043267, model.impactDurationInSec()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T01:35:59Z"), model.notBefore()); - Assertions.assertEquals("e", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateInner model = new UpdateInner().withMaintenanceScope(MaintenanceScope.SQLDB) - .withImpactType(ImpactType.REDEPLOY) - .withStatus(UpdateStatus.CANCEL) - .withImpactDurationInSec(1073043267) - .withNotBefore(OffsetDateTime.parse("2021-07-12T01:35:59Z")) - .withResourceId("e"); - model = BinaryData.fromObject(model).toObject(UpdateInner.class); - Assertions.assertEquals(MaintenanceScope.SQLDB, model.maintenanceScope()); - Assertions.assertEquals(ImpactType.REDEPLOY, model.impactType()); - Assertions.assertEquals(UpdateStatus.CANCEL, model.status()); - Assertions.assertEquals(1073043267, model.impactDurationInSec()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T01:35:59Z"), model.notBefore()); - Assertions.assertEquals("e", model.resourceId()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatePropertiesTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatePropertiesTests.java deleted file mode 100644 index 5769596a4314..000000000000 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatePropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.maintenance.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.maintenance.fluent.models.UpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class UpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateProperties model = BinaryData.fromString("{\"resourceId\":\"dultskz\"}").toObject(UpdateProperties.class); - Assertions.assertEquals("dultskz", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateProperties model = new UpdateProperties().withResourceId("dultskz"); - model = BinaryData.fromObject(model).toObject(UpdateProperties.class); - Assertions.assertEquals("dultskz", model.resourceId()); - } -} diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesListMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupsListMockTests.java similarity index 51% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesListMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupsListMockTests.java index 6c4e03124d41..c42ccd8d2e0b 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesListMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ImpactType; @@ -21,27 +21,27 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class UpdatesListMockTests { +public final class UpdatesOperationGroupsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"maintenanceScope\":\"Extension\",\"impactType\":\"None\",\"status\":\"Cancel\",\"impactDurationInSec\":1094064824,\"notBefore\":\"2021-06-12T21:48:36Z\",\"properties\":{\"resourceId\":\"awx\"}}]}"; + = "{\"value\":[{\"maintenanceScope\":\"OSImage\",\"impactType\":\"Redeploy\",\"status\":\"InProgress\",\"impactDurationInSec\":197015788,\"notBefore\":\"2021-07-01T10:55:59Z\",\"properties\":{\"resourceId\":\"xoafgaoqltfae\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.updates().list("juj", "ickpz", "cpopmxel", "wcltyjede", com.azure.core.util.Context.NONE); + PagedIterable response = manager.updatesOperationGroups() + .list("qgleohibetnluank", "rfxeeebtij", "acvbmqz", "qqxlajr", com.azure.core.util.Context.NONE); - Assertions.assertEquals(MaintenanceScope.EXTENSION, response.iterator().next().maintenanceScope()); - Assertions.assertEquals(ImpactType.NONE, response.iterator().next().impactType()); - Assertions.assertEquals(UpdateStatus.CANCEL, response.iterator().next().status()); - Assertions.assertEquals(1094064824, response.iterator().next().impactDurationInSec()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T21:48:36Z"), response.iterator().next().notBefore()); - Assertions.assertEquals("awx", response.iterator().next().resourceId()); + Assertions.assertEquals(MaintenanceScope.OSIMAGE, response.iterator().next().maintenanceScope()); + Assertions.assertEquals(ImpactType.REDEPLOY, response.iterator().next().impactType()); + Assertions.assertEquals(UpdateStatus.IN_PROGRESS, response.iterator().next().status()); + Assertions.assertEquals(197015788, response.iterator().next().impactDurationInSec()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T10:55:59Z"), response.iterator().next().notBefore()); + Assertions.assertEquals("xoafgaoqltfae", response.iterator().next().properties().resourceId()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesListParentMockTests.java b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupsListParentMockTests.java similarity index 54% rename from sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesListParentMockTests.java rename to sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupsListParentMockTests.java index f7803a855b19..9dc99d6480e6 100644 --- a/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesListParentMockTests.java +++ b/sdk/maintenance/azure-resourcemanager-maintenance/src/test/java/com/azure/resourcemanager/maintenance/generated/UpdatesOperationGroupsListParentMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.maintenance.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.maintenance.MaintenanceManager; import com.azure.resourcemanager.maintenance.models.ImpactType; @@ -21,28 +21,28 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class UpdatesListParentMockTests { +public final class UpdatesOperationGroupsListParentMockTests { @Test public void testListParent() throws Exception { String responseStr - = "{\"value\":[{\"maintenanceScope\":\"Extension\",\"impactType\":\"Freeze\",\"status\":\"InProgress\",\"impactDurationInSec\":2001173638,\"notBefore\":\"2021-01-30T14:11:32Z\",\"properties\":{\"resourceId\":\"n\"}}]}"; + = "{\"value\":[{\"maintenanceScope\":\"SQLDB\",\"impactType\":\"Restart\",\"status\":\"NoUpdatesPending\",\"impactDurationInSec\":1052982888,\"notBefore\":\"2021-07-27T14:52:36Z\",\"properties\":{\"resourceId\":\"czbgomfgbeg\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); MaintenanceManager manager = MaintenanceManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.updates() - .listParent("xlhslnel", "ieixynllxe", "wcrojphslhcaw", "u", "i", "dwfmvigorqjb", + PagedIterable response = manager.updatesOperationGroups() + .listParent("fdvruz", "lzo", "hpc", "fnmdxotn", "fdgugeyzi", "grkyuizabsnmfpph", com.azure.core.util.Context.NONE); - Assertions.assertEquals(MaintenanceScope.EXTENSION, response.iterator().next().maintenanceScope()); - Assertions.assertEquals(ImpactType.FREEZE, response.iterator().next().impactType()); - Assertions.assertEquals(UpdateStatus.IN_PROGRESS, response.iterator().next().status()); - Assertions.assertEquals(2001173638, response.iterator().next().impactDurationInSec()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T14:11:32Z"), response.iterator().next().notBefore()); - Assertions.assertEquals("n", response.iterator().next().resourceId()); + Assertions.assertEquals(MaintenanceScope.SQLDB, response.iterator().next().maintenanceScope()); + Assertions.assertEquals(ImpactType.RESTART, response.iterator().next().impactType()); + Assertions.assertEquals(UpdateStatus.NO_UPDATES_PENDING, response.iterator().next().status()); + Assertions.assertEquals(1052982888, response.iterator().next().impactDurationInSec()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T14:52:36Z"), response.iterator().next().notBefore()); + Assertions.assertEquals("czbgomfgbeg", response.iterator().next().properties().resourceId()); } } diff --git a/sdk/maintenance/azure-resourcemanager-maintenance/tsp-location.yaml b/sdk/maintenance/azure-resourcemanager-maintenance/tsp-location.yaml new file mode 100644 index 000000000000..966baad61668 --- /dev/null +++ b/sdk/maintenance/azure-resourcemanager-maintenance/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/maintenance/Maintenance.Management +commit: c1f9771c605e8835d1a80d6ad7e86ae11ebf8b25 +repo: Azure/azure-rest-api-specs +additionalDirectories: