From 65ff04a6c8e52415815cbd2720d7ec9c82351b95 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 10 Nov 2023 18:02:09 +0000 Subject: [PATCH] CodeGen from PR 26341 in Azure/azure-rest-api-specs [Microsoft.Workloads/monitors] Add a new API version 2023-10-01-preview (#26341) * Adding the base for Microsoft.Workloads/monitors from previous version * Added readme files * Added new version changes * Added commonTypes v2 file and updated Operations_List * Updated readme * Removed Canceled provisioning state from existing resources * Changed extension name in readme files and updated readme for go * Fixed lint errors * Removed 200 status code from delete examples * Added suppression for GuidUsage lint error * Reverting back to v3 for common-types to fix failing SDK checks * Updated readme * Removed length constraints * Updated regex patterns for monitors and providers --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 107 ++ .../SAMPLE.md | 963 +++++++++++ .../pom.xml | 62 + .../WorkloadsManager.java | 332 ++++ .../fluent/MonitorsClient.java | 272 +++ .../fluent/OperationsClient.java | 38 + .../fluent/ProviderInstancesClient.java | 252 +++ .../fluent/SapLandscapeMonitorsClient.java | 200 +++ .../fluent/WorkloadsClient.java | 74 + .../fluent/models/MonitorInner.java | 291 ++++ .../fluent/models/MonitorProperties.java | 261 +++ .../fluent/models/OperationInner.java | 127 ++ .../fluent/models/ProviderInstanceInner.java | 113 ++ .../models/ProviderInstanceProperties.java | 108 ++ .../models/SapLandscapeMonitorInner.java | 121 ++ .../SapLandscapeMonitorListResultInner.java | 80 + .../models/SapLandscapeMonitorProperties.java | 104 ++ .../fluent/models/package-info.java | 6 + .../fluent/package-info.java | 6 + .../implementation/MonitorImpl.java | 272 +++ .../implementation/MonitorsClientImpl.java | 1525 +++++++++++++++++ .../implementation/MonitorsImpl.java | 170 ++ .../implementation/OperationImpl.java | 52 + .../implementation/OperationsClientImpl.java | 276 +++ .../implementation/OperationsImpl.java | 46 + .../implementation/ProviderInstanceImpl.java | 129 ++ .../ProviderInstancesClientImpl.java | 1241 ++++++++++++++ .../implementation/ProviderInstancesImpl.java | 196 +++ .../SapLandscapeMonitorImpl.java | 68 + .../SapLandscapeMonitorListResultImpl.java | 52 + .../SapLandscapeMonitorsClientImpl.java | 994 +++++++++++ .../SapLandscapeMonitorsImpl.java | 158 ++ .../implementation/Utils.java | 204 +++ .../WorkloadsClientBuilder.java | 144 ++ .../implementation/WorkloadsClientImpl.java | 332 ++++ .../implementation/package-info.java | 6 + .../models/ActionType.java | 44 + .../models/DB2ProviderInstanceProperties.java | 264 +++ .../models/Error.java | 106 ++ .../models/ErrorInnerError.java | 53 + .../HanaDbProviderInstanceProperties.java | 316 ++++ .../models/Health.java | 54 + .../models/ManagedRGConfiguration.java | 50 + .../models/ManagedServiceIdentity.java | 141 ++ .../models/ManagedServiceIdentityType.java | 50 + .../models/Monitor.java | 400 +++++ .../models/MonitorListResult.java | 81 + .../models/MonitorPropertiesErrors.java | 25 + .../models/Monitors.java | 184 ++ ...MsSqlServerProviderInstanceProperties.java | 238 +++ .../models/Operation.java | 56 + .../models/OperationDisplay.java | 91 + .../models/OperationListResult.java | 62 + .../models/Operations.java | 33 + .../models/OperationsDefinitionDisplay.java | 53 + .../models/OperationsDisplayDefinition.java | 155 ++ .../models/Origin.java | 53 + ...usHaClusterProviderInstanceProperties.java | 186 ++ ...rometheusOSProviderInstanceProperties.java | 136 ++ .../models/ProviderInstance.java | 147 ++ .../models/ProviderInstanceListResult.java | 81 + .../ProviderInstancePropertiesErrors.java | 25 + .../models/ProviderInstances.java | 178 ++ .../models/ProviderSpecificProperties.java | 40 + .../models/RoutingPreference.java | 47 + .../models/SapLandscapeMonitor.java | 70 + .../models/SapLandscapeMonitorListResult.java | 34 + .../SapLandscapeMonitorMetricThresholds.java | 128 ++ ...SapLandscapeMonitorPropertiesGrouping.java | 84 + .../SapLandscapeMonitorProvisioningState.java | 57 + .../models/SapLandscapeMonitorSidMapping.java | 77 + .../models/SapLandscapeMonitors.java | 187 ++ ...apNetWeaverProviderInstanceProperties.java | 317 ++++ .../models/SslPreference.java | 50 + .../models/UpdateMonitorRequest.java | 82 + .../models/UserAssignedIdentity.java | 55 + .../WorkloadMonitorProvisioningState.java | 65 + .../WorkloadProviderInstanceHealthState.java | 54 + .../models/package-info.java | 6 + .../package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../proxy-config.json | 1 + .../reflect-config.json | 206 +++ .../generated/MonitorsCreateSamples.java | 114 ++ .../generated/MonitorsDeleteSamples.java | 21 + .../generated/MonitorsGetByResourceGroup.java | 23 + .../generated/MonitorsListByResourceGrou.java | 21 + .../generated/MonitorsListSamples.java | 21 + .../generated/MonitorsUpdateSamples.java | 70 + .../generated/OperationsListSamples.java | 21 + .../generated/ProviderInstancesCreateSam.java | 337 ++++ .../generated/ProviderInstancesDeleteSam.java | 23 + .../ProviderInstancesGetSamples.java | 98 ++ .../generated/ProviderInstancesListSampl.java | 21 + .../generated/SapLandscapeMonitorCreateS.java | 55 + .../generated/SapLandscapeMonitorDeleteS.java | 23 + .../generated/SapLandscapeMonitorGetSamp.java | 23 + .../generated/SapLandscapeMonitorListSam.java | 23 + .../generated/SapLandscapeMonitorUpdateS.java | 55 + .../ci.yml | 47 + .../pom.xml | 15 + 104 files changed, 15247 insertions(+) create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/CHANGELOG.md create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/README.md create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/SAMPLE.md create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/pom.xml create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/WorkloadsManager.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/MonitorsClient.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/OperationsClient.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/ProviderInstancesClient.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/SapLandscapeMonitorsClient.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/WorkloadsClient.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorInner.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/OperationInner.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceInner.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorInner.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorListResultInner.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstanceImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorListResultImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/Utils.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientBuilder.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ActionType.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/DB2ProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Error.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ErrorInnerError.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/HanaDbProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Health.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedRGConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentity.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentityType.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitor.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorListResult.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorPropertiesErrors.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitors.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MsSqlServerProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operation.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationDisplay.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationListResult.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operations.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDefinitionDisplay.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDisplayDefinition.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Origin.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusHaClusterProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusOSProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstance.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstanceListResult.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstancePropertiesErrors.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstances.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderSpecificProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/RoutingPreference.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitor.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorListResult.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorMetricThresholds.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorPropertiesGrouping.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorProvisioningState.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorSidMapping.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitors.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapNetWeaverProviderInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SslPreference.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UpdateMonitorRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UserAssignedIdentity.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadMonitorProvisioningState.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadProviderInstanceHealthState.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/module-info.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/proxy-config.json create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/reflect-config.json create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsCreateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsDeleteSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsGetByResourceGroup.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListByResourceGrou.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsUpdateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/OperationsListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesCreateSam.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesDeleteSam.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesGetSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesListSampl.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorCreateS.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorDeleteS.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorGetSamp.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorListSam.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorUpdateS.java create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/ci.yml create mode 100644 sdk/workloadsmicrosoftworkloadsmonitors/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 1bb1978ac576..1a4c136422a9 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -436,6 +436,7 @@ com.azure.resourcemanager:azure-resourcemanager-apicenter;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-playwrighttesting;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesdatareplication;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-workloadsmicrosoftworkloadsmonitors;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index c4535f0b1718..fd734b68a95e 100644 --- a/pom.xml +++ b/pom.xml @@ -203,5 +203,6 @@ sdk/voiceservices sdk/webpubsub sdk/workloads + sdk/workloadsmicrosoftworkloadsmonitors diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/CHANGELOG.md b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/CHANGELOG.md new file mode 100644 index 000000000000..2f978dd43e8c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-11-10) + +- Azure Resource Manager Workloads client library for Java. This package contains Microsoft Azure SDK for Workloads Management SDK. The workload SAP monitor Client. Package tag package-preview-2023-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/README.md b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/README.md new file mode 100644 index 000000000000..63f1488473b9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager Workloads client library for Java + +Azure Resource Manager Workloads client library for Java. + +This package contains Microsoft Azure SDK for Workloads Management SDK. The workload SAP monitor Client. Package tag package-preview-2023-10-01-preview. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-workloadsmicrosoftworkloadsmonitors;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-workloadsmicrosoftworkloadsmonitors + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +WorkloadsManager manager = WorkloadsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fworkloadsmicrosoftworkloadsmonitors%2Fazure-resourcemanager-workloadsmicrosoftworkloadsmonitors%2FREADME.png) diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/SAMPLE.md b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/SAMPLE.md new file mode 100644 index 000000000000..b11f7e5bde70 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/SAMPLE.md @@ -0,0 +1,963 @@ +# Code snippets and samples + + +## Monitors + +- [Create](#monitors_create) +- [Delete](#monitors_delete) +- [GetByResourceGroup](#monitors_getbyresourcegroup) +- [List](#monitors_list) +- [ListByResourceGroup](#monitors_listbyresourcegroup) +- [Update](#monitors_update) + +## Operations + +- [List](#operations_list) + +## ProviderInstances + +- [Create](#providerinstances_create) +- [Delete](#providerinstances_delete) +- [Get](#providerinstances_get) +- [List](#providerinstances_list) + +## SapLandscapeMonitor + +- [Create](#saplandscapemonitor_create) +- [Delete](#saplandscapemonitor_delete) +- [Get](#saplandscapemonitor_get) +- [List](#saplandscapemonitor_list) +- [Update](#saplandscapemonitor_update) +### Monitors_Create + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.RoutingPreference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors Create. */ +public final class MonitorsCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Create_UserAssignedIdentity.json + */ + /** + * Sample code: Create a SAP monitor with user assigned identity. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorWithUserAssignedIdentity( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity( + new ManagedServiceIdentity() + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userassignedmsi", + new UserAssignedIdentity())) + .withType(ManagedServiceIdentityType.USER_ASSIGNED)) + .withAppLocation("westus") + .withRoutingPreference(RoutingPreference.ROUTE_ALL) + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Create.json + */ + /** + * Sample code: Create a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withAppLocation("westus") + .withRoutingPreference(RoutingPreference.ROUTE_ALL) + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Create_Identity.json + */ + /** + * Sample code: Create a SAP monitor with system assigned identity. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorWithSystemAssignedIdentity( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withAppLocation("westus") + .withRoutingPreference(RoutingPreference.ROUTE_ALL) + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .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; + } +} +``` + +### Monitors_Delete + +```java +/** Samples for Monitors Delete. */ +public final class MonitorsDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deletesASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.monitors().delete("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_GetByResourceGroup + +```java +/** Samples for Monitors GetByResourceGroup. */ +public final class MonitorsGetByResourceGroup { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_List + +```java +/** Samples for Monitors List. */ +public final class MonitorsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_List.json + */ + /** + * Sample code: List all SAP monitors in a subscription. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void listAllSAPMonitorsInASubscription( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.monitors().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_ListByResourceGroup + +```java +/** Samples for Monitors ListByResourceGroup. */ +public final class MonitorsListByResourceGrou { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_ListByRG.json + */ + /** + * Sample code: List all SAP monitors in a resource group. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void listAllSAPMonitorsInAResourceGroup( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.monitors().listByResourceGroup("example-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_Update + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Monitor; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors Update. */ +public final class MonitorsUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deleteTagsFieldOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + Monitor resource = + manager + .monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_PatchTags.json + */ + /** + * Sample code: Update Tags field of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void updateTagsFieldOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + Monitor resource = + manager + .monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .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; + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/operations/preview/2023-10-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void operations( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ProviderInstances_Create + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.DB2ProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.HanaDbProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MsSqlServerProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.PrometheusHaClusterProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.PrometheusOSProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapNetWeaverProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SslPreference; +import java.util.Arrays; + +/** Samples for ProviderInstances Create. */ +public final class ProviderInstancesCreateSam { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/MsSqlServerProviderInstance/MsSqlServerProviderInstance_Create.json + */ + /** + * Sample code: Create a MsSqlServer provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAMsSqlServerProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new MsSqlServerProviderInstanceProperties() + .withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Db2ProviderInstances/Db2ProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a Db2 provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createADb2ProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new DB2ProviderInstanceProperties() + .withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Create.json + */ + /** + * Sample code: Create a SAP monitor Hana provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorHanaProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new HanaDbProviderInstanceProperties() + .withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSapSid("SID")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/NetWeaverProviderInstances/NetWeaverProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a SAP monitor NetWeaver provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorNetWeaverProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new SapNetWeaverProviderInstanceProperties() + .withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/MsSqlServerProviderInstance/MsSqlServerProviderInstance_Create_Root_Certificate.json + */ + /** + * Sample code: Create a MsSqlServer provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAMsSqlServerProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new MsSqlServerProviderInstanceProperties() + .withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusHaClusterProviderInstances/PrometheusHaClusterProviderInstances_Create.json + */ + /** + * Sample code: Create a PrometheusHaCluster provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAPrometheusHaClusterProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusHaClusterProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withHostname("hostname") + .withSid("sid") + .withClusterName("clusterName") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusHaClusterProviderInstances/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a PrometheusHaCluster provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAPrometheusHaClusterProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusHaClusterProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withHostname("hostname") + .withSid("sid") + .withClusterName("clusterName") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Db2ProviderInstances/Db2ProviderInstances_Create.json + */ + /** + * Sample code: Create a Db2 provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createADb2Provider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new DB2ProviderInstanceProperties() + .withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusOSProviderInstances/PrometheusOSProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a OS provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAOSProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusOSProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withSslPreference(SslPreference.ROOT_CERTIFICATE) + .withSapSid("SID")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusOSProviderInstances/PrometheusOSProviderInstances_Create.json + */ + /** + * Sample code: Create a OS provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAOSProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusOSProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSapSid("SID")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/NetWeaverProviderInstances/NetWeaverProviderInstances_Create.json + */ + /** + * Sample code: Create a SAP monitor NetWeaver provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorNetWeaverProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new SapNetWeaverProviderInstanceProperties() + .withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslPreference(SslPreference.SERVER_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a SAP monitor Hana provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorHanaProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new HanaDbProviderInstanceProperties() + .withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.ROOT_CERTIFICATE) + .withSapSid("SID")) + .create(); + } +} +``` + +### ProviderInstances_Delete + +```java +/** Samples for ProviderInstances Delete. */ +public final class ProviderInstancesDeleteSam { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deletesASAPMonitorProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .delete("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### ProviderInstances_Get + +```java +/** Samples for ProviderInstances Get. */ +public final class ProviderInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor Hana provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitorHanaProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusHaClusterProviderInstances/PrometheusHaClusterProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a PrometheusHaCluster provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfAPrometheusHaClusterProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusOSProviderInstances/PrometheusOSProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a OS provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfAOSProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Db2ProviderInstances/Db2ProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a Db2 provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfADb2Provider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/MsSqlServerProviderInstance/MsSqlServerProviderInstance_Get.json + */ + /** + * Sample code: Get properties of a MsSqlServer provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfAMsSqlServerProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/NetWeaverProviderInstances/NetWeaverProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor NetWeaver provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitorNetWeaverProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### ProviderInstances_List + +```java +/** Samples for ProviderInstances List. */ +public final class ProviderInstancesListSampl { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_List.json + */ + /** + * Sample code: List all SAP monitors providers in a subscription. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void listAllSAPMonitorsProvidersInASubscription( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.providerInstances().list("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### SapLandscapeMonitor_Create + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorSidMapping; +import java.util.Arrays; + +/** Samples for SapLandscapeMonitor Create. */ +public final class SapLandscapeMonitorCreateS { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Create.json + */ + /** + * Sample code: Create for SAP Landscape monitor Dashboard. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createForSAPLandscapeMonitorDashboard( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .createWithResponse( + "myResourceGroup", + "mySapMonitor", + new SapLandscapeMonitorInner() + .withGrouping( + new SapLandscapeMonitorPropertiesGrouping() + .withLandscape( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withTopMetricsThresholds( + Arrays + .asList( + new SapLandscapeMonitorMetricThresholds() + .withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), + com.azure.core.util.Context.NONE); + } +} +``` + +### SapLandscapeMonitor_Delete + +```java +/** Samples for SapLandscapeMonitor Delete. */ +public final class SapLandscapeMonitorDeleteS { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Delete.json + */ + /** + * Sample code: Deletes SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deletesSAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .deleteByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### SapLandscapeMonitor_Get + +```java +/** Samples for SapLandscapeMonitor Get. */ +public final class SapLandscapeMonitorGetSamp { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .getWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### SapLandscapeMonitor_List + +```java +/** Samples for SapLandscapeMonitor List. */ +public final class SapLandscapeMonitorListSam { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_List.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .listWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### SapLandscapeMonitor_Update + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorSidMapping; +import java.util.Arrays; + +/** Samples for SapLandscapeMonitor Update. */ +public final class SapLandscapeMonitorUpdateS { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Update.json + */ + /** + * Sample code: Update SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void updateSAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .updateWithResponse( + "myResourceGroup", + "mySapMonitor", + new SapLandscapeMonitorInner() + .withGrouping( + new SapLandscapeMonitorPropertiesGrouping() + .withLandscape( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withTopMetricsThresholds( + Arrays + .asList( + new SapLandscapeMonitorMetricThresholds() + .withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), + com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/pom.xml b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/pom.xml new file mode 100644 index 000000000000..3372cf9f6a6f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-workloadsmicrosoftworkloadsmonitors + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Workloads Management + This package contains Microsoft Azure SDK for Workloads Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The workload SAP monitor Client. Package tag package-preview-2023-10-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.45.0 + + + com.azure + azure-core-management + 1.11.8 + + + diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/WorkloadsManager.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/WorkloadsManager.java new file mode 100644 index 000000000000..15609faa88fb --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/WorkloadsManager.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.WorkloadsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.MonitorsImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.OperationsImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.ProviderInstancesImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.SapLandscapeMonitorsImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.WorkloadsClientBuilder; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Monitors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Operations; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitors; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to WorkloadsManager. The workload SAP monitor Client. */ +public final class WorkloadsManager { + private Monitors monitors; + + private ProviderInstances providerInstances; + + private SapLandscapeMonitors sapLandscapeMonitors; + + private Operations operations; + + private final WorkloadsClient clientObject; + + private WorkloadsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new WorkloadsClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Workloads service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Workloads service API instance. + */ + public static WorkloadsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Workloads service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Workloads service API instance. + */ + public static WorkloadsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new WorkloadsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create WorkloadsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new WorkloadsManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Workloads service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Workloads service API instance. + */ + public WorkloadsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new WorkloadsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Monitors. It manages Monitor. + * + * @return Resource collection API of Monitors. + */ + public Monitors monitors() { + if (this.monitors == null) { + this.monitors = new MonitorsImpl(clientObject.getMonitors(), this); + } + return monitors; + } + + /** + * Gets the resource collection API of ProviderInstances. It manages ProviderInstance. + * + * @return Resource collection API of ProviderInstances. + */ + public ProviderInstances providerInstances() { + if (this.providerInstances == null) { + this.providerInstances = new ProviderInstancesImpl(clientObject.getProviderInstances(), this); + } + return providerInstances; + } + + /** + * Gets the resource collection API of SapLandscapeMonitors. + * + * @return Resource collection API of SapLandscapeMonitors. + */ + public SapLandscapeMonitors sapLandscapeMonitors() { + if (this.sapLandscapeMonitors == null) { + this.sapLandscapeMonitors = new SapLandscapeMonitorsImpl(clientObject.getSapLandscapeMonitors(), this); + } + return sapLandscapeMonitors; + } + + /** + * 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 wrapped service client WorkloadsClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client WorkloadsClient. + */ + public WorkloadsClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/MonitorsClient.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/MonitorsClient.java new file mode 100644 index 000000000000..c4fa1b87d73b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/MonitorsClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UpdateMonitorRequest; + +/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +public interface MonitorsClient { + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorInner getByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitorInner> beginCreate( + String resourceGroupName, String monitorName, MonitorInner monitorParameter); + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitorInner> beginCreate( + String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context); + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorInner create(String resourceGroupName, String monitorName, MonitorInner monitorParameter); + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorInner create(String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, Context context); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, Context context); + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String monitorName, UpdateMonitorRequest body, Context context); + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitorInner update(String resourceGroupName, String monitorName, UpdateMonitorRequest body); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/OperationsClient.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/OperationsClient.java new file mode 100644 index 000000000000..0deccb0387bf --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all the available API operations under this PR. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/ProviderInstancesClient.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/ProviderInstancesClient.java new file mode 100644 index 000000000000..e3bbef10f4d9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/ProviderInstancesClient.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner; + +/** An instance of this class provides access to all the operations defined in ProviderInstancesClient. */ +public interface ProviderInstancesClient { + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String monitorName, Context context); + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String monitorName, String providerInstanceName, Context context); + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner get(String resourceGroupName, String monitorName, String providerInstanceName); + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter); + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context); + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner create( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter); + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInstanceInner create( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String providerInstanceName); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String providerInstanceName, Context context); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, String providerInstanceName); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName, String providerInstanceName, Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/SapLandscapeMonitorsClient.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/SapLandscapeMonitorsClient.java new file mode 100644 index 000000000000..57ccbb17916a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/SapLandscapeMonitorsClient.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner; + +/** An instance of this class provides access to all the operations defined in SapLandscapeMonitorsClient. */ +public interface SapLandscapeMonitorsClient { + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapLandscapeMonitorInner get(String resourceGroupName, String monitorName); + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context); + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapLandscapeMonitorInner create( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String monitorName); + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context); + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapLandscapeMonitorInner update( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapLandscapeMonitorListResultInner list(String resourceGroupName, String monitorName); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/WorkloadsClient.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/WorkloadsClient.java new file mode 100644 index 000000000000..5e9d1664c94f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/WorkloadsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for WorkloadsClient class. */ +public interface WorkloadsClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the MonitorsClient object to access its operations. + * + * @return the MonitorsClient object. + */ + MonitorsClient getMonitors(); + + /** + * Gets the ProviderInstancesClient object to access its operations. + * + * @return the ProviderInstancesClient object. + */ + ProviderInstancesClient getProviderInstances(); + + /** + * Gets the SapLandscapeMonitorsClient object to access its operations. + * + * @return the SapLandscapeMonitorsClient object. + */ + SapLandscapeMonitorsClient getSapLandscapeMonitors(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorInner.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorInner.java new file mode 100644 index 000000000000..6ac09bacc3cd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorInner.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MonitorPropertiesErrors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.RoutingPreference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** SAP monitor info on Azure (ARM properties and SAP monitor properties). */ +@Fluent +public final class MonitorInner extends Resource { + /* + * The Managed service identity. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * SAP monitor properties + */ + @JsonProperty(value = "properties") + private MonitorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of MonitorInner class. */ + public MonitorInner() { + } + + /** + * Get the identity property: The Managed service identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed service identity. + * + * @param identity the identity value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: SAP monitor properties. + * + * @return the innerProperties value. + */ + private MonitorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public MonitorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MonitorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: State of provisioning of the SAP monitor. + * + * @return the provisioningState value. + */ + public WorkloadMonitorProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the SAP monitor errors. + * + * @return the errors value. + */ + public MonitorPropertiesErrors errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Get the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet + * region should be same as the SAP monitoring region. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.innerProperties() == null ? null : this.innerProperties().appLocation(); + } + + /** + * Set the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet + * region should be same as the SAP monitoring region. + * + * @param appLocation the appLocation value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withAppLocation(String appLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withAppLocation(appLocation); + return this; + } + + /** + * Get the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 + * traffic is routed to the customer VNET. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().routingPreference(); + } + + /** + * Set the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 + * traffic is routed to the customer VNET. + * + * @param routingPreference the routingPreference value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withRoutingPreference(RoutingPreference routingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withRoutingPreference(routingPreference); + return this; + } + + /** + * Get the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the + * SAP monitor. By default resources will be created which do not support zone redundancy. + * + * @return the zoneRedundancyPreference value. + */ + public String zoneRedundancyPreference() { + return this.innerProperties() == null ? null : this.innerProperties().zoneRedundancyPreference(); + } + + /** + * Set the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the + * SAP monitor. By default resources will be created which do not support zone redundancy. + * + * @param zoneRedundancyPreference the zoneRedundancyPreference value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withZoneRedundancyPreference(String zoneRedundancyPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withZoneRedundancyPreference(zoneRedundancyPreference); + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration(); + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + public String logAnalyticsWorkspaceArmId() { + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsWorkspaceArmId(); + } + + /** + * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. + * + * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withLogAnalyticsWorkspaceArmId(logAnalyticsWorkspaceArmId); + return this; + } + + /** + * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + public String monitorSubnet() { + return this.innerProperties() == null ? null : this.innerProperties().monitorSubnet(); + } + + /** + * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet the monitorSubnet value to set. + * @return the MonitorInner object itself. + */ + public MonitorInner withMonitorSubnet(String monitorSubnet) { + if (this.innerProperties() == null) { + this.innerProperties = new MonitorProperties(); + } + this.innerProperties().withMonitorSubnet(monitorSubnet); + return this; + } + + /** + * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring. + * + * @return the msiArmId value. + */ + public String msiArmId() { + return this.innerProperties() == null ? null : this.innerProperties().msiArmId(); + } + + /** + * Get the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring. + * + * @return the storageAccountArmId value. + */ + public String storageAccountArmId() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccountArmId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorProperties.java new file mode 100644 index 000000000000..f71c24a59638 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/MonitorProperties.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MonitorPropertiesErrors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.RoutingPreference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a SAP monitor. */ +@Fluent +public final class MonitorProperties { + /* + * State of provisioning of the SAP monitor. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadMonitorProvisioningState provisioningState; + + /* + * Defines the SAP monitor errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private MonitorPropertiesErrors errors; + + /* + * The SAP monitor resources will be deployed in the SAP monitoring region. The subnet region should be same as the + * SAP monitoring region. + */ + @JsonProperty(value = "appLocation") + private String appLocation; + + /* + * Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. + */ + @JsonProperty(value = "routingPreference") + private RoutingPreference routingPreference; + + /* + * Sets the preference for zone redundancy on resources created for the SAP monitor. By default resources will be + * created which do not support zone redundancy. + */ + @JsonProperty(value = "zoneRedundancyPreference") + private String zoneRedundancyPreference; + + /* + * Managed resource group configuration + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedRGConfiguration managedResourceGroupConfiguration; + + /* + * The ARM ID of the Log Analytics Workspace that is used for SAP monitoring. + */ + @JsonProperty(value = "logAnalyticsWorkspaceArmId") + private String logAnalyticsWorkspaceArmId; + + /* + * The subnet which the SAP monitor will be deployed in + */ + @JsonProperty(value = "monitorSubnet") + private String monitorSubnet; + + /* + * The ARM ID of the MSI used for SAP monitoring. + */ + @JsonProperty(value = "msiArmId", access = JsonProperty.Access.WRITE_ONLY) + private String msiArmId; + + /* + * The ARM ID of the Storage account used for SAP monitoring. + */ + @JsonProperty(value = "storageAccountArmId", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountArmId; + + /** Creates an instance of MonitorProperties class. */ + public MonitorProperties() { + } + + /** + * Get the provisioningState property: State of provisioning of the SAP monitor. + * + * @return the provisioningState value. + */ + public WorkloadMonitorProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the SAP monitor errors. + * + * @return the errors value. + */ + public MonitorPropertiesErrors errors() { + return this.errors; + } + + /** + * Get the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet + * region should be same as the SAP monitoring region. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet + * region should be same as the SAP monitoring region. + * + * @param appLocation the appLocation value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 + * traffic is routed to the customer VNET. + * + * @return the routingPreference value. + */ + public RoutingPreference routingPreference() { + return this.routingPreference; + } + + /** + * Set the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 + * traffic is routed to the customer VNET. + * + * @param routingPreference the routingPreference value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withRoutingPreference(RoutingPreference routingPreference) { + this.routingPreference = routingPreference; + return this; + } + + /** + * Get the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the + * SAP monitor. By default resources will be created which do not support zone redundancy. + * + * @return the zoneRedundancyPreference value. + */ + public String zoneRedundancyPreference() { + return this.zoneRedundancyPreference; + } + + /** + * Set the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the + * SAP monitor. By default resources will be created which do not support zone redundancy. + * + * @param zoneRedundancyPreference the zoneRedundancyPreference value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withZoneRedundancyPreference(String zoneRedundancyPreference) { + this.zoneRedundancyPreference = zoneRedundancyPreference; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + public String logAnalyticsWorkspaceArmId() { + return this.logAnalyticsWorkspaceArmId; + } + + /** + * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. + * + * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + this.logAnalyticsWorkspaceArmId = logAnalyticsWorkspaceArmId; + return this; + } + + /** + * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + public String monitorSubnet() { + return this.monitorSubnet; + } + + /** + * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet the monitorSubnet value to set. + * @return the MonitorProperties object itself. + */ + public MonitorProperties withMonitorSubnet(String monitorSubnet) { + this.monitorSubnet = monitorSubnet; + return this; + } + + /** + * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring. + * + * @return the msiArmId value. + */ + public String msiArmId() { + return this.msiArmId; + } + + /** + * Get the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring. + * + * @return the storageAccountArmId value. + */ + public String storageAccountArmId() { + return this.storageAccountArmId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/OperationInner.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/OperationInner.java new file mode 100644 index 000000000000..159458100eee --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ActionType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationDisplay; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * 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. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: 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 Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceInner.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceInner.java new file mode 100644 index 000000000000..9395911cae9b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceInner.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Health; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstancePropertiesErrors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderSpecificProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A provider instance associated with SAP monitor. */ +@Fluent +public final class ProviderInstanceInner extends ProxyResource { + /* + * Provider Instance properties + */ + @JsonProperty(value = "properties") + private ProviderInstanceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ProviderInstanceInner class. */ + public ProviderInstanceInner() { + } + + /** + * Get the innerProperties property: Provider Instance properties. + * + * @return the innerProperties value. + */ + private ProviderInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + public WorkloadMonitorProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the health property: Resource health details. + * + * @return the health value. + */ + public Health health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the errors property: Defines the provider instance errors. + * + * @return the errors value. + */ + public ProviderInstancePropertiesErrors errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Get the providerSettings property: Defines the provider specific properties. + * + * @return the providerSettings value. + */ + public ProviderSpecificProperties providerSettings() { + return this.innerProperties() == null ? null : this.innerProperties().providerSettings(); + } + + /** + * Set the providerSettings property: Defines the provider specific properties. + * + * @param providerSettings the providerSettings value to set. + * @return the ProviderInstanceInner object itself. + */ + public ProviderInstanceInner withProviderSettings(ProviderSpecificProperties providerSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ProviderInstanceProperties(); + } + this.innerProperties().withProviderSettings(providerSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceProperties.java new file mode 100644 index 000000000000..ed274f6a871b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/ProviderInstanceProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Health; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstancePropertiesErrors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderSpecificProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a provider instance. */ +@Fluent +public final class ProviderInstanceProperties { + /* + * State of provisioning of the provider instance + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadMonitorProvisioningState provisioningState; + + /* + * Resource health details + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private Health health; + + /* + * Defines the provider instance errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private ProviderInstancePropertiesErrors errors; + + /* + * Defines the provider specific properties. + */ + @JsonProperty(value = "providerSettings") + private ProviderSpecificProperties providerSettings; + + /** Creates an instance of ProviderInstanceProperties class. */ + public ProviderInstanceProperties() { + } + + /** + * Get the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + public WorkloadMonitorProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the health property: Resource health details. + * + * @return the health value. + */ + public Health health() { + return this.health; + } + + /** + * Get the errors property: Defines the provider instance errors. + * + * @return the errors value. + */ + public ProviderInstancePropertiesErrors errors() { + return this.errors; + } + + /** + * Get the providerSettings property: Defines the provider specific properties. + * + * @return the providerSettings value. + */ + public ProviderSpecificProperties providerSettings() { + return this.providerSettings; + } + + /** + * Set the providerSettings property: Defines the provider specific properties. + * + * @param providerSettings the providerSettings value to set. + * @return the ProviderInstanceProperties object itself. + */ + public ProviderInstanceProperties withProviderSettings(ProviderSpecificProperties providerSettings) { + this.providerSettings = providerSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (health() != null) { + health().validate(); + } + if (errors() != null) { + errors().validate(); + } + if (providerSettings() != null) { + providerSettings().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorInner.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorInner.java new file mode 100644 index 000000000000..278fddae8eca --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorInner.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** configuration associated with SAP Landscape Monitor Dashboard. */ +@Fluent +public final class SapLandscapeMonitorInner extends ProxyResource { + /* + * Sap Landscape Monitor properties + */ + @JsonProperty(value = "properties") + private SapLandscapeMonitorProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SapLandscapeMonitorInner class. */ + public SapLandscapeMonitorInner() { + } + + /** + * Get the innerProperties property: Sap Landscape Monitor properties. + * + * @return the innerProperties value. + */ + private SapLandscapeMonitorProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: State of provisioning of the SAP monitor. + * + * @return the provisioningState value. + */ + public SapLandscapeMonitorProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the grouping property: Gets or sets the SID groupings by landscape and Environment. + * + * @return the grouping value. + */ + public SapLandscapeMonitorPropertiesGrouping grouping() { + return this.innerProperties() == null ? null : this.innerProperties().grouping(); + } + + /** + * Set the grouping property: Gets or sets the SID groupings by landscape and Environment. + * + * @param grouping the grouping value to set. + * @return the SapLandscapeMonitorInner object itself. + */ + public SapLandscapeMonitorInner withGrouping(SapLandscapeMonitorPropertiesGrouping grouping) { + if (this.innerProperties() == null) { + this.innerProperties = new SapLandscapeMonitorProperties(); + } + this.innerProperties().withGrouping(grouping); + return this; + } + + /** + * Get the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor + * Dashboard. + * + * @return the topMetricsThresholds value. + */ + public List topMetricsThresholds() { + return this.innerProperties() == null ? null : this.innerProperties().topMetricsThresholds(); + } + + /** + * Set the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor + * Dashboard. + * + * @param topMetricsThresholds the topMetricsThresholds value to set. + * @return the SapLandscapeMonitorInner object itself. + */ + public SapLandscapeMonitorInner withTopMetricsThresholds( + List topMetricsThresholds) { + if (this.innerProperties() == null) { + this.innerProperties = new SapLandscapeMonitorProperties(); + } + this.innerProperties().withTopMetricsThresholds(topMetricsThresholds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorListResultInner.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorListResultInner.java new file mode 100644 index 000000000000..d3fa68b0f4f2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorListResultInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List SAP Landscape Monitor Dashboard operation. */ +@Fluent +public final class SapLandscapeMonitorListResultInner { + /* + * The list of Sap Landscape Monitor configuration. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of SAP Landscape Monitor Dashboard. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SapLandscapeMonitorListResultInner class. */ + public SapLandscapeMonitorListResultInner() { + } + + /** + * Get the value property: The list of Sap Landscape Monitor configuration. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Sap Landscape Monitor configuration. + * + * @param value the value value to set. + * @return the SapLandscapeMonitorListResultInner object itself. + */ + public SapLandscapeMonitorListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of SAP Landscape Monitor Dashboard. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of SAP Landscape Monitor Dashboard. + * + * @param nextLink the nextLink value to set. + * @return the SapLandscapeMonitorListResultInner object itself. + */ + public SapLandscapeMonitorListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorProperties.java new file mode 100644 index 000000000000..af11bda42d7a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/SapLandscapeMonitorProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Gets or sets the properties for Sap Landscape Monitor Dashboard. */ +@Fluent +public final class SapLandscapeMonitorProperties { + /* + * State of provisioning of the SAP monitor. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private SapLandscapeMonitorProvisioningState provisioningState; + + /* + * Gets or sets the SID groupings by landscape and Environment. + */ + @JsonProperty(value = "grouping") + private SapLandscapeMonitorPropertiesGrouping grouping; + + /* + * Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor Dashboard + */ + @JsonProperty(value = "topMetricsThresholds") + private List topMetricsThresholds; + + /** Creates an instance of SapLandscapeMonitorProperties class. */ + public SapLandscapeMonitorProperties() { + } + + /** + * Get the provisioningState property: State of provisioning of the SAP monitor. + * + * @return the provisioningState value. + */ + public SapLandscapeMonitorProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the grouping property: Gets or sets the SID groupings by landscape and Environment. + * + * @return the grouping value. + */ + public SapLandscapeMonitorPropertiesGrouping grouping() { + return this.grouping; + } + + /** + * Set the grouping property: Gets or sets the SID groupings by landscape and Environment. + * + * @param grouping the grouping value to set. + * @return the SapLandscapeMonitorProperties object itself. + */ + public SapLandscapeMonitorProperties withGrouping(SapLandscapeMonitorPropertiesGrouping grouping) { + this.grouping = grouping; + return this; + } + + /** + * Get the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor + * Dashboard. + * + * @return the topMetricsThresholds value. + */ + public List topMetricsThresholds() { + return this.topMetricsThresholds; + } + + /** + * Set the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor + * Dashboard. + * + * @param topMetricsThresholds the topMetricsThresholds value to set. + * @return the SapLandscapeMonitorProperties object itself. + */ + public SapLandscapeMonitorProperties withTopMetricsThresholds( + List topMetricsThresholds) { + this.topMetricsThresholds = topMetricsThresholds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (grouping() != null) { + grouping().validate(); + } + if (topMetricsThresholds() != null) { + topMetricsThresholds().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/package-info.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/package-info.java new file mode 100644 index 000000000000..6cdfb38c58cd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for WorkloadsClient. The workload SAP monitor Client. */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/package-info.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/package-info.java new file mode 100644 index 000000000000..7ad15fe18f3c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for WorkloadsClient. The workload SAP monitor Client. */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent; diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorImpl.java new file mode 100644 index 000000000000..0c1d5a5d6a85 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Monitor; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MonitorPropertiesErrors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.RoutingPreference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UpdateMonitorRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class MonitorImpl implements Monitor, Monitor.Definition, Monitor.Update { + private MonitorInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WorkloadMonitorProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public MonitorPropertiesErrors errors() { + return this.innerModel().errors(); + } + + public String appLocation() { + return this.innerModel().appLocation(); + } + + public RoutingPreference routingPreference() { + return this.innerModel().routingPreference(); + } + + public String zoneRedundancyPreference() { + return this.innerModel().zoneRedundancyPreference(); + } + + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public String logAnalyticsWorkspaceArmId() { + return this.innerModel().logAnalyticsWorkspaceArmId(); + } + + public String monitorSubnet() { + return this.innerModel().monitorSubnet(); + } + + public String msiArmId() { + return this.innerModel().msiArmId(); + } + + public String storageAccountArmId() { + return this.innerModel().storageAccountArmId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public MonitorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private UpdateMonitorRequest updateBody; + + public MonitorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Monitor create() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .create(resourceGroupName, monitorName, this.innerModel(), Context.NONE); + return this; + } + + public Monitor create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .create(resourceGroupName, monitorName, this.innerModel(), context); + return this; + } + + MonitorImpl( + String name, com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = new MonitorInner(); + this.serviceManager = serviceManager; + this.monitorName = name; + } + + public MonitorImpl update() { + this.updateBody = new UpdateMonitorRequest(); + return this; + } + + public Monitor apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public Monitor apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .updateWithResponse(resourceGroupName, monitorName, updateBody, context) + .getValue(); + return this; + } + + MonitorImpl( + MonitorInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors"); + } + + public Monitor refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE) + .getValue(); + return this; + } + + public Monitor refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMonitors() + .getByResourceGroupWithResponse(resourceGroupName, monitorName, context) + .getValue(); + return this; + } + + public MonitorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MonitorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MonitorImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public MonitorImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBody.withIdentity(identity); + return this; + } + } + + public MonitorImpl withAppLocation(String appLocation) { + this.innerModel().withAppLocation(appLocation); + return this; + } + + public MonitorImpl withRoutingPreference(RoutingPreference routingPreference) { + this.innerModel().withRoutingPreference(routingPreference); + return this; + } + + public MonitorImpl withZoneRedundancyPreference(String zoneRedundancyPreference) { + this.innerModel().withZoneRedundancyPreference(zoneRedundancyPreference); + return this; + } + + public MonitorImpl withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + public MonitorImpl withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) { + this.innerModel().withLogAnalyticsWorkspaceArmId(logAnalyticsWorkspaceArmId); + return this; + } + + public MonitorImpl withMonitorSubnet(String monitorSubnet) { + this.innerModel().withMonitorSubnet(monitorSubnet); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsClientImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsClientImpl.java new file mode 100644 index 000000000000..6d252ae1364a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsClientImpl.java @@ -0,0 +1,1525 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.MonitorsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MonitorListResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UpdateMonitorRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MonitorsClient. */ +public final class MonitorsClientImpl implements MonitorsClient { + /** The proxy service used to perform REST calls. */ + private final MonitorsService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of MonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MonitorsClientImpl(WorkloadsClientImpl client) { + this.service = RestProxy.create(MonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientMonitors to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientMonit") + public interface MonitorsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/monitors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") 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.Workloads/monitors/{monitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MonitorInner monitorParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") UpdateMonitorRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified 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())); + } + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified 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.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified 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())); + } + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified 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.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified 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), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified 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)); + } + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String monitorName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String monitorName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String monitorName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorInner getByResourceGroup(String resourceGroupName, String monitorName) { + return getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (monitorParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter monitorParameter is required and cannot be null.")); + } else { + monitorParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + monitorParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String monitorName, MonitorInner monitorParameter, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (monitorParameter == null) { + return Mono + .error(new IllegalArgumentException("Parameter monitorParameter is required and cannot be null.")); + } else { + monitorParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + monitorParameter, + accept, + context); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitorInner> beginCreateAsync( + String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, monitorName, monitorParameter); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MonitorInner.class, MonitorInner.class, this.client.getContext()); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitorInner> beginCreateAsync( + String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, monitorName, monitorParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), MonitorInner.class, MonitorInner.class, context); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitorInner> beginCreate( + String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + return this.beginCreateAsync(resourceGroupName, monitorName, monitorParameter).getSyncPoller(); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of sAP monitor info on Azure (ARM properties and SAP monitor + * properties). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitorInner> beginCreate( + String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + return this.beginCreateAsync(resourceGroupName, monitorName, monitorParameter, context).getSyncPoller(); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + return beginCreateAsync(resourceGroupName, monitorName, monitorParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + return beginCreateAsync(resourceGroupName, monitorName, monitorParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorInner create(String resourceGroupName, String monitorName, MonitorInner monitorParameter) { + return createAsync(resourceGroupName, monitorName, monitorParameter).block(); + } + + /** + * Creates a SAP monitor. + * + *

Creates a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param monitorParameter Request body representing a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorInner create( + String resourceGroupName, String monitorName, MonitorInner monitorParameter, Context context) { + return createAsync(resourceGroupName, monitorName, monitorParameter, context).block(); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName) { + return this.beginDeleteAsync(resourceGroupName, monitorName).getSyncPoller(); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, Context context) { + return this.beginDeleteAsync(resourceGroupName, monitorName, context).getSyncPoller(); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName) { + return beginDeleteAsync(resourceGroupName, monitorName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName) { + deleteAsync(resourceGroupName, monitorName).block(); + } + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, Context context) { + deleteAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, UpdateMonitorRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, UpdateMonitorRequest body, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + body, + accept, + context); + } + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String monitorName, UpdateMonitorRequest body) { + return updateWithResponseAsync(resourceGroupName, monitorName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties) along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String monitorName, UpdateMonitorRequest body, Context context) { + return updateWithResponseAsync(resourceGroupName, monitorName, body, context).block(); + } + + /** + * Patches the Tags field of a SAP monitor. + * + *

Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param body The Update SAP workload monitor request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP monitor info on Azure (ARM properties and SAP monitor properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitorInner update(String resourceGroupName, String monitorName, UpdateMonitorRequest body) { + return updateWithResponse(resourceGroupName, monitorName, body, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List SAP monitors operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsImpl.java new file mode 100644 index 000000000000..20ec24c27766 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/MonitorsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.MonitorsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Monitor; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Monitors; + +public final class MonitorsImpl implements Monitors { + private static final ClientLogger LOGGER = new ClientLogger(MonitorsImpl.class); + + private final MonitorsClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + public MonitorsImpl( + MonitorsClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new MonitorImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MonitorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Monitor getByResourceGroup(String resourceGroupName, String monitorName) { + MonitorInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, monitorName); + if (inner != null) { + return new MonitorImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String monitorName) { + this.serviceClient().delete(resourceGroupName, monitorName); + } + + public void delete(String resourceGroupName, String monitorName, Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, context); + } + + public Monitor getById(String id) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + this.delete(resourceGroupName, monitorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + this.delete(resourceGroupName, monitorName, context); + } + + private MonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } + + public MonitorImpl define(String name) { + return new MonitorImpl(name, this.manager()); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationImpl.java new file mode 100644 index 000000000000..deaf8da98feb --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ActionType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Operation; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationDisplay; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsClientImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..d4a948baadb1 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.OperationsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientOpera") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Workloads/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available API operations under this PR. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available API operations under this PR. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available API operations under this PR. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsImpl.java new file mode 100644 index 000000000000..2d96e1f61fea --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.OperationsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Operation; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstanceImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstanceImpl.java new file mode 100644 index 000000000000..04900dec71d7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstanceImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Health; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstancePropertiesErrors; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderSpecificProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState; + +public final class ProviderInstanceImpl implements ProviderInstance, ProviderInstance.Definition { + private ProviderInstanceInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + ProviderInstanceImpl( + ProviderInstanceInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WorkloadMonitorProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Health health() { + return this.innerModel().health(); + } + + public ProviderInstancePropertiesErrors errors() { + return this.innerModel().errors(); + } + + public ProviderSpecificProperties providerSettings() { + return this.innerModel().providerSettings(); + } + + public ProviderInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String monitorName; + + private String providerInstanceName; + + public ProviderInstanceImpl withExistingMonitor(String resourceGroupName, String monitorName) { + this.resourceGroupName = resourceGroupName; + this.monitorName = monitorName; + return this; + } + + public ProviderInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .create(resourceGroupName, monitorName, providerInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public ProviderInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .create(resourceGroupName, monitorName, providerInstanceName, this.innerModel(), context); + return this; + } + + ProviderInstanceImpl( + String name, com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = new ProviderInstanceInner(); + this.serviceManager = serviceManager; + this.providerInstanceName = name; + } + + public ProviderInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, monitorName, providerInstanceName, Context.NONE) + .getValue(); + return this; + } + + public ProviderInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getProviderInstances() + .getWithResponse(resourceGroupName, monitorName, providerInstanceName, context) + .getValue(); + return this; + } + + public ProviderInstanceImpl withProviderSettings(ProviderSpecificProperties providerSettings) { + this.innerModel().withProviderSettings(providerSettings); + return this; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesClientImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesClientImpl.java new file mode 100644 index 000000000000..0800c61076f9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesClientImpl.java @@ -0,0 +1,1241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstanceListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProviderInstancesClient. */ +public final class ProviderInstancesClientImpl implements ProviderInstancesClient { + /** The proxy service used to perform REST calls. */ + private final ProviderInstancesService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of ProviderInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProviderInstancesClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(ProviderInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientProviderInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientProvi") + public interface ProviderInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @BodyParam("application/json") ProviderInstanceInner providerInstanceParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/providerInstances/{providerInstanceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @PathParam("providerInstanceName") String providerInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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, + monitorName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String monitorName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, monitorName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, monitorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName)); + } + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String monitorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, monitorName, context)); + } + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String providerInstanceName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName 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, + monitorName, + providerInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, String providerInstanceName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + providerInstanceName, + accept, + context); + } + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String monitorName, String providerInstanceName) { + return getWithResponseAsync(resourceGroupName, monitorName, providerInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, context).block(); + } + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner get(String resourceGroupName, String monitorName, String providerInstanceName) { + return getWithResponse(resourceGroupName, monitorName, providerInstanceName, Context.NONE).getValue(); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + if (providerInstanceParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter providerInstanceParameter is required and cannot be null.")); + } else { + providerInstanceParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + providerInstanceName, + providerInstanceParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + if (providerInstanceParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter providerInstanceParameter is required and cannot be null.")); + } else { + providerInstanceParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + providerInstanceName, + providerInstanceParameter, + accept, + context); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProviderInstanceInner> beginCreateAsync( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ProviderInstanceInner.class, + ProviderInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ProviderInstanceInner> beginCreateAsync( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ProviderInstanceInner.class, ProviderInstanceInner.class, context); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return this + .beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter) + .getSyncPoller(); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ProviderInstanceInner> beginCreate( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return this + .beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context) + .getSyncPoller(); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return beginCreateAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return beginCreateAsync( + resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner create( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter) { + return createAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter).block(); + } + + /** + * Creates a provider instance. + * + *

Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param providerInstanceParameter Request body representing a provider instance associated with a SAP monitor. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a provider instance associated with SAP monitor. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInstanceInner create( + String resourceGroupName, + String monitorName, + String providerInstanceName, + ProviderInstanceInner providerInstanceParameter, + Context context) { + return createAsync(resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, context) + .block(); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, String providerInstanceName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName 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, + monitorName, + providerInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String monitorName, String providerInstanceName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (providerInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter providerInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + providerInstanceName, + accept, + context); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, String providerInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, monitorName, providerInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, monitorName, providerInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String providerInstanceName) { + return this.beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName).getSyncPoller(); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName, context).getSyncPoller(); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName, String providerInstanceName) { + return beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, monitorName, providerInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, String providerInstanceName) { + deleteAsync(resourceGroupName, monitorName, providerInstanceName).block(); + } + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + deleteAsync(resourceGroupName, monitorName, providerInstanceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List provider instances operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List provider instances operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesImpl.java new file mode 100644 index 000000000000..2b79cb59de87 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/ProviderInstancesImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstances; + +public final class ProviderInstancesImpl implements ProviderInstances { + private static final ClientLogger LOGGER = new ClientLogger(ProviderInstancesImpl.class); + + private final ProviderInstancesClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + public ProviderInstancesImpl( + ProviderInstancesClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String monitorName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, monitorName); + return Utils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String monitorName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, monitorName, context); + return Utils.mapPage(inner, inner1 -> new ProviderInstanceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, monitorName, providerInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProviderInstance get(String resourceGroupName, String monitorName, String providerInstanceName) { + ProviderInstanceInner inner = this.serviceClient().get(resourceGroupName, monitorName, providerInstanceName); + if (inner != null) { + return new ProviderInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String monitorName, String providerInstanceName) { + this.serviceClient().delete(resourceGroupName, monitorName, providerInstanceName); + } + + public void delete(String resourceGroupName, String monitorName, String providerInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, providerInstanceName, context); + } + + public ProviderInstance getById(String id) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, monitorName, providerInstanceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, monitorName, providerInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + this.delete(resourceGroupName, monitorName, providerInstanceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 monitorName = Utils.getValueFromIdByName(id, "monitors"); + if (monitorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id))); + } + String providerInstanceName = Utils.getValueFromIdByName(id, "providerInstances"); + if (providerInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'providerInstances'.", id))); + } + this.delete(resourceGroupName, monitorName, providerInstanceName, context); + } + + private ProviderInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } + + public ProviderInstanceImpl define(String name) { + return new ProviderInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorImpl.java new file mode 100644 index 000000000000..3a3d369cd05b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitor; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class SapLandscapeMonitorImpl implements SapLandscapeMonitor { + private SapLandscapeMonitorInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + SapLandscapeMonitorImpl( + SapLandscapeMonitorInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SapLandscapeMonitorProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapLandscapeMonitorPropertiesGrouping grouping() { + return this.innerModel().grouping(); + } + + public List topMetricsThresholds() { + List inner = this.innerModel().topMetricsThresholds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapLandscapeMonitorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorListResultImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorListResultImpl.java new file mode 100644 index 000000000000..9b0ee33c38f4 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorListResultImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitor; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SapLandscapeMonitorListResultImpl implements SapLandscapeMonitorListResult { + private SapLandscapeMonitorListResultInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + SapLandscapeMonitorListResultImpl( + SapLandscapeMonitorListResultInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new SapLandscapeMonitorImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public SapLandscapeMonitorListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsClientImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsClientImpl.java new file mode 100644 index 000000000000..6cbca14ee879 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsClientImpl.java @@ -0,0 +1,994 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.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.workloadsmicrosoftworkloadsmonitors.fluent.SapLandscapeMonitorsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapLandscapeMonitorsClient. */ +public final class SapLandscapeMonitorsClientImpl implements SapLandscapeMonitorsClient { + /** The proxy service used to perform REST calls. */ + private final SapLandscapeMonitorsService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of SapLandscapeMonitorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapLandscapeMonitorsClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy + .create(SapLandscapeMonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapLandscapeMonitors to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapLa") + public interface SapLandscapeMonitorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SapLandscapeMonitorInner sapLandscapeMonitorParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SapLandscapeMonitorInner sapLandscapeMonitorParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/monitors/{monitorName}/sapLandscapeMonitor") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String monitorName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String monitorName) { + return getWithResponseAsync(resourceGroupName, monitorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String monitorName, Context context) { + return getWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapLandscapeMonitorInner get(String resourceGroupName, String monitorName) { + return getWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (sapLandscapeMonitorParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + } else { + sapLandscapeMonitorParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + sapLandscapeMonitorParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (sapLandscapeMonitorParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + } else { + sapLandscapeMonitorParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + sapLandscapeMonitorParameter, + accept, + context); + } + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + return createWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context) { + return createWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context).block(); + } + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapLandscapeMonitorInner create( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + return createWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, Context.NONE) + .getValue(); + } + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String monitorName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String monitorName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String monitorName) { + return deleteWithResponseAsync(resourceGroupName, monitorName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String monitorName, Context context) { + return deleteWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String monitorName) { + deleteWithResponse(resourceGroupName, monitorName, Context.NONE); + } + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (sapLandscapeMonitorParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + } else { + sapLandscapeMonitorParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + sapLandscapeMonitorParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (sapLandscapeMonitorParameter == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter sapLandscapeMonitorParameter is required and cannot be null.")); + } else { + sapLandscapeMonitorParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + sapLandscapeMonitorParameter, + accept, + context); + } + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + return updateWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context) { + return updateWithResponseAsync(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context).block(); + } + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 associated with SAP Landscape Monitor Dashboard. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapLandscapeMonitorInner update( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + return updateWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, Context.NONE) + .getValue(); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String monitorName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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, + monitorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String monitorName, 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + monitorName, + accept, + context); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String monitorName) { + return listWithResponseAsync(resourceGroupName, monitorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String monitorName, Context context) { + return listWithResponseAsync(resourceGroupName, monitorName, context).block(); + } + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapLandscapeMonitorListResultInner list(String resourceGroupName, String monitorName) { + return listWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsImpl.java new file mode 100644 index 000000000000..dca5e03a85dd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/SapLandscapeMonitorsImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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.workloadsmicrosoftworkloadsmonitors.fluent.SapLandscapeMonitorsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitor; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorListResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitors; + +public final class SapLandscapeMonitorsImpl implements SapLandscapeMonitors { + private static final ClientLogger LOGGER = new ClientLogger(SapLandscapeMonitorsImpl.class); + + private final SapLandscapeMonitorsClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager; + + public SapLandscapeMonitorsImpl( + SapLandscapeMonitorsClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String monitorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapLandscapeMonitorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapLandscapeMonitor get(String resourceGroupName, String monitorName) { + SapLandscapeMonitorInner inner = this.serviceClient().get(resourceGroupName, monitorName); + if (inner != null) { + return new SapLandscapeMonitorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context) { + Response inner = + this + .serviceClient() + .createWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapLandscapeMonitorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapLandscapeMonitor create( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + SapLandscapeMonitorInner inner = + this.serviceClient().create(resourceGroupName, monitorName, sapLandscapeMonitorParameter); + if (inner != null) { + return new SapLandscapeMonitorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String monitorName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, monitorName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String monitorName) { + this.serviceClient().delete(resourceGroupName, monitorName); + } + + public Response updateWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse(resourceGroupName, monitorName, sapLandscapeMonitorParameter, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapLandscapeMonitorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapLandscapeMonitor update( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter) { + SapLandscapeMonitorInner inner = + this.serviceClient().update(resourceGroupName, monitorName, sapLandscapeMonitorParameter); + if (inner != null) { + return new SapLandscapeMonitorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String monitorName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapLandscapeMonitorListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapLandscapeMonitorListResult list(String resourceGroupName, String monitorName) { + SapLandscapeMonitorListResultInner inner = this.serviceClient().list(resourceGroupName, monitorName); + if (inner != null) { + return new SapLandscapeMonitorListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private SapLandscapeMonitorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/Utils.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/Utils.java new file mode 100644 index 000000000000..2a5cd9a4afb9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + private Utils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientBuilder.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientBuilder.java new file mode 100644 index 000000000000..3408bb761aac --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the WorkloadsClientImpl type. */ +@ServiceClientBuilder(serviceClients = {WorkloadsClientImpl.class}) +public final class WorkloadsClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of WorkloadsClientImpl with the provided parameters. + * + * @return an instance of WorkloadsClientImpl. + */ + public WorkloadsClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + WorkloadsClientImpl client = + new WorkloadsClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + this.subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientImpl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientImpl.java new file mode 100644 index 000000000000..531b70fdbafc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/WorkloadsClientImpl.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +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.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.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.MonitorsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.OperationsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.ProviderInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.SapLandscapeMonitorsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.WorkloadsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the WorkloadsClientImpl type. */ +@ServiceClient(builder = WorkloadsClientBuilder.class) +public final class WorkloadsClientImpl implements WorkloadsClient { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The MonitorsClient object to access its operations. */ + private final MonitorsClient monitors; + + /** + * Gets the MonitorsClient object to access its operations. + * + * @return the MonitorsClient object. + */ + public MonitorsClient getMonitors() { + return this.monitors; + } + + /** The ProviderInstancesClient object to access its operations. */ + private final ProviderInstancesClient providerInstances; + + /** + * Gets the ProviderInstancesClient object to access its operations. + * + * @return the ProviderInstancesClient object. + */ + public ProviderInstancesClient getProviderInstances() { + return this.providerInstances; + } + + /** The SapLandscapeMonitorsClient object to access its operations. */ + private final SapLandscapeMonitorsClient sapLandscapeMonitors; + + /** + * Gets the SapLandscapeMonitorsClient object to access its operations. + * + * @return the SapLandscapeMonitorsClient object. + */ + public SapLandscapeMonitorsClient getSapLandscapeMonitors() { + return this.sapLandscapeMonitors; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * Initializes an instance of WorkloadsClient 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 subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + WorkloadsClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-10-01-preview"; + this.monitors = new MonitorsClientImpl(this); + this.providerInstances = new ProviderInstancesClientImpl(this); + this.sapLandscapeMonitors = new SapLandscapeMonitorsClientImpl(this); + this.operations = new OperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadsClientImpl.class); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/package-info.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/package-info.java new file mode 100644 index 000000000000..51c3f52d97b8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for WorkloadsClient. The workload SAP monitor Client. */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation; diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ActionType.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ActionType.java new file mode 100644 index 000000000000..954c6d3db346 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + 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. + */ + @JsonCreator + 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/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/DB2ProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/DB2ProviderInstanceProperties.java new file mode 100644 index 000000000000..2922737ea40d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/DB2ProviderInstanceProperties.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Gets or sets the DB2 provider properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") +@JsonTypeName("Db2") +@Fluent +public final class DB2ProviderInstanceProperties extends ProviderSpecificProperties { + /* + * Gets or sets the target virtual machine name. + */ + @JsonProperty(value = "hostname") + private String hostname; + + /* + * Gets or sets the db2 database name. + */ + @JsonProperty(value = "dbName") + private String dbName; + + /* + * Gets or sets the db2 database sql port. + */ + @JsonProperty(value = "dbPort") + private String dbPort; + + /* + * Gets or sets the db2 database user name. + */ + @JsonProperty(value = "dbUsername") + private String dbUsername; + + /* + * Gets or sets the db2 database password. + */ + @JsonProperty(value = "dbPassword") + private String dbPassword; + + /* + * Gets or sets the key vault URI to secret with the database password. + */ + @JsonProperty(value = "dbPasswordUri") + private String dbPasswordUri; + + /* + * Gets or sets the SAP System Identifier + */ + @JsonProperty(value = "sapSid") + private String sapSid; + + /* + * Gets or sets certificate preference if secure communication is enabled. + */ + @JsonProperty(value = "sslPreference") + private SslPreference sslPreference; + + /* + * Gets or sets the blob URI to SSL certificate for the DB2 Database. + */ + @JsonProperty(value = "sslCertificateUri") + private String sslCertificateUri; + + /** Creates an instance of DB2ProviderInstanceProperties class. */ + public DB2ProviderInstanceProperties() { + } + + /** + * Get the hostname property: Gets or sets the target virtual machine name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Gets or sets the target virtual machine name. + * + * @param hostname the hostname value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the dbName property: Gets or sets the db2 database name. + * + * @return the dbName value. + */ + public String dbName() { + return this.dbName; + } + + /** + * Set the dbName property: Gets or sets the db2 database name. + * + * @param dbName the dbName value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withDbName(String dbName) { + this.dbName = dbName; + return this; + } + + /** + * Get the dbPort property: Gets or sets the db2 database sql port. + * + * @return the dbPort value. + */ + public String dbPort() { + return this.dbPort; + } + + /** + * Set the dbPort property: Gets or sets the db2 database sql port. + * + * @param dbPort the dbPort value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withDbPort(String dbPort) { + this.dbPort = dbPort; + return this; + } + + /** + * Get the dbUsername property: Gets or sets the db2 database user name. + * + * @return the dbUsername value. + */ + public String dbUsername() { + return this.dbUsername; + } + + /** + * Set the dbUsername property: Gets or sets the db2 database user name. + * + * @param dbUsername the dbUsername value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withDbUsername(String dbUsername) { + this.dbUsername = dbUsername; + return this; + } + + /** + * Get the dbPassword property: Gets or sets the db2 database password. + * + * @return the dbPassword value. + */ + public String dbPassword() { + return this.dbPassword; + } + + /** + * Set the dbPassword property: Gets or sets the db2 database password. + * + * @param dbPassword the dbPassword value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withDbPassword(String dbPassword) { + this.dbPassword = dbPassword; + return this; + } + + /** + * Get the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. + * + * @return the dbPasswordUri value. + */ + public String dbPasswordUri() { + return this.dbPasswordUri; + } + + /** + * Set the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. + * + * @param dbPasswordUri the dbPasswordUri value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withDbPasswordUri(String dbPasswordUri) { + this.dbPasswordUri = dbPasswordUri; + return this; + } + + /** + * Get the sapSid property: Gets or sets the SAP System Identifier. + * + * @return the sapSid value. + */ + public String sapSid() { + return this.sapSid; + } + + /** + * Set the sapSid property: Gets or sets the SAP System Identifier. + * + * @param sapSid the sapSid value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withSapSid(String sapSid) { + this.sapSid = sapSid; + return this; + } + + /** + * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @return the sslPreference value. + */ + public SslPreference sslPreference() { + return this.sslPreference; + } + + /** + * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @param sslPreference the sslPreference value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withSslPreference(SslPreference sslPreference) { + this.sslPreference = sslPreference; + return this; + } + + /** + * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB2 Database. + * + * @return the sslCertificateUri value. + */ + public String sslCertificateUri() { + return this.sslCertificateUri; + } + + /** + * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB2 Database. + * + * @param sslCertificateUri the sslCertificateUri value to set. + * @return the DB2ProviderInstanceProperties object itself. + */ + public DB2ProviderInstanceProperties withSslCertificateUri(String sslCertificateUri) { + this.sslCertificateUri = sslCertificateUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Error.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Error.java new file mode 100644 index 000000000000..7f324efd7b42 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Error.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Standard error object. */ +@Immutable +public class Error { + /* + * Server-defined set of error codes. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Human-readable representation of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Target of the error. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /* + * Array of details about specific errors that led to this reported error. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /* + * Object containing more specific information than the current object about the error. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private ErrorInnerError innerError; + + /** Creates an instance of Error class. */ + public Error() { + } + + /** + * Get the code property: Server-defined set of error codes. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Human-readable representation of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the target property: Target of the error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Get the details property: Array of details about specific errors that led to this reported error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Get the innerError property: Object containing more specific information than the current object about the error. + * + * @return the innerError value. + */ + public ErrorInnerError innerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + if (innerError() != null) { + innerError().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ErrorInnerError.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ErrorInnerError.java new file mode 100644 index 000000000000..1dee8d390042 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ErrorInnerError.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object containing more specific information than the current object about the error. */ +@Fluent +public final class ErrorInnerError { + /* + * Standard error object. + */ + @JsonProperty(value = "innerError") + private Error innerError; + + /** Creates an instance of ErrorInnerError class. */ + public ErrorInnerError() { + } + + /** + * Get the innerError property: Standard error object. + * + * @return the innerError value. + */ + public Error innerError() { + return this.innerError; + } + + /** + * Set the innerError property: Standard error object. + * + * @param innerError the innerError value to set. + * @return the ErrorInnerError object itself. + */ + public ErrorInnerError withInnerError(Error innerError) { + this.innerError = innerError; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerError() != null) { + innerError().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/HanaDbProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/HanaDbProviderInstanceProperties.java new file mode 100644 index 000000000000..8248056a5727 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/HanaDbProviderInstanceProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Gets or sets the provider properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") +@JsonTypeName("SapHana") +@Fluent +public final class HanaDbProviderInstanceProperties extends ProviderSpecificProperties { + /* + * Gets or sets the target virtual machine size. + */ + @JsonProperty(value = "hostname") + private String hostname; + + /* + * Gets or sets the hana database name. + */ + @JsonProperty(value = "dbName") + private String dbName; + + /* + * Gets or sets the database sql port. + */ + @JsonProperty(value = "sqlPort") + private String sqlPort; + + /* + * Gets or sets the database instance number. + */ + @JsonProperty(value = "instanceNumber") + private String instanceNumber; + + /* + * Gets or sets the database user name. + */ + @JsonProperty(value = "dbUsername") + private String dbUsername; + + /* + * Gets or sets the database password. + */ + @JsonProperty(value = "dbPassword") + private String dbPassword; + + /* + * Gets or sets the key vault URI to secret with the database password. + */ + @JsonProperty(value = "dbPasswordUri") + private String dbPasswordUri; + + /* + * Gets or sets the blob URI to SSL certificate for the DB. + */ + @JsonProperty(value = "sslCertificateUri") + private String sslCertificateUri; + + /* + * Gets or sets the hostname(s) in the SSL certificate. + */ + @JsonProperty(value = "sslHostNameInCertificate") + private String sslHostnameInCertificate; + + /* + * Gets or sets certificate preference if secure communication is enabled. + */ + @JsonProperty(value = "sslPreference") + private SslPreference sslPreference; + + /* + * Gets or sets the SAP System Identifier. + */ + @JsonProperty(value = "sapSid") + private String sapSid; + + /** Creates an instance of HanaDbProviderInstanceProperties class. */ + public HanaDbProviderInstanceProperties() { + } + + /** + * Get the hostname property: Gets or sets the target virtual machine size. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Gets or sets the target virtual machine size. + * + * @param hostname the hostname value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the dbName property: Gets or sets the hana database name. + * + * @return the dbName value. + */ + public String dbName() { + return this.dbName; + } + + /** + * Set the dbName property: Gets or sets the hana database name. + * + * @param dbName the dbName value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withDbName(String dbName) { + this.dbName = dbName; + return this; + } + + /** + * Get the sqlPort property: Gets or sets the database sql port. + * + * @return the sqlPort value. + */ + public String sqlPort() { + return this.sqlPort; + } + + /** + * Set the sqlPort property: Gets or sets the database sql port. + * + * @param sqlPort the sqlPort value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withSqlPort(String sqlPort) { + this.sqlPort = sqlPort; + return this; + } + + /** + * Get the instanceNumber property: Gets or sets the database instance number. + * + * @return the instanceNumber value. + */ + public String instanceNumber() { + return this.instanceNumber; + } + + /** + * Set the instanceNumber property: Gets or sets the database instance number. + * + * @param instanceNumber the instanceNumber value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withInstanceNumber(String instanceNumber) { + this.instanceNumber = instanceNumber; + return this; + } + + /** + * Get the dbUsername property: Gets or sets the database user name. + * + * @return the dbUsername value. + */ + public String dbUsername() { + return this.dbUsername; + } + + /** + * Set the dbUsername property: Gets or sets the database user name. + * + * @param dbUsername the dbUsername value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withDbUsername(String dbUsername) { + this.dbUsername = dbUsername; + return this; + } + + /** + * Get the dbPassword property: Gets or sets the database password. + * + * @return the dbPassword value. + */ + public String dbPassword() { + return this.dbPassword; + } + + /** + * Set the dbPassword property: Gets or sets the database password. + * + * @param dbPassword the dbPassword value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withDbPassword(String dbPassword) { + this.dbPassword = dbPassword; + return this; + } + + /** + * Get the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. + * + * @return the dbPasswordUri value. + */ + public String dbPasswordUri() { + return this.dbPasswordUri; + } + + /** + * Set the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. + * + * @param dbPasswordUri the dbPasswordUri value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withDbPasswordUri(String dbPasswordUri) { + this.dbPasswordUri = dbPasswordUri; + return this; + } + + /** + * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB. + * + * @return the sslCertificateUri value. + */ + public String sslCertificateUri() { + return this.sslCertificateUri; + } + + /** + * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the DB. + * + * @param sslCertificateUri the sslCertificateUri value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withSslCertificateUri(String sslCertificateUri) { + this.sslCertificateUri = sslCertificateUri; + return this; + } + + /** + * Get the sslHostnameInCertificate property: Gets or sets the hostname(s) in the SSL certificate. + * + * @return the sslHostnameInCertificate value. + */ + public String sslHostnameInCertificate() { + return this.sslHostnameInCertificate; + } + + /** + * Set the sslHostnameInCertificate property: Gets or sets the hostname(s) in the SSL certificate. + * + * @param sslHostnameInCertificate the sslHostnameInCertificate value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withSslHostnameInCertificate(String sslHostnameInCertificate) { + this.sslHostnameInCertificate = sslHostnameInCertificate; + return this; + } + + /** + * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @return the sslPreference value. + */ + public SslPreference sslPreference() { + return this.sslPreference; + } + + /** + * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @param sslPreference the sslPreference value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withSslPreference(SslPreference sslPreference) { + this.sslPreference = sslPreference; + return this; + } + + /** + * Get the sapSid property: Gets or sets the SAP System Identifier. + * + * @return the sapSid value. + */ + public String sapSid() { + return this.sapSid; + } + + /** + * Set the sapSid property: Gets or sets the SAP System Identifier. + * + * @param sapSid the sapSid value to set. + * @return the HanaDbProviderInstanceProperties object itself. + */ + public HanaDbProviderInstanceProperties withSapSid(String sapSid) { + this.sapSid = sapSid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Health.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Health.java new file mode 100644 index 000000000000..1cf669109ac5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Health.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource health details. */ +@Immutable +public final class Health { + /* + * State of health of the provider instance + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadProviderInstanceHealthState healthState; + + /* + * Reasons impacting health state + */ + @JsonProperty(value = "impactingReasons", access = JsonProperty.Access.WRITE_ONLY) + private String impactingReasons; + + /** Creates an instance of Health class. */ + public Health() { + } + + /** + * Get the healthState property: State of health of the provider instance. + * + * @return the healthState value. + */ + public WorkloadProviderInstanceHealthState healthState() { + return this.healthState; + } + + /** + * Get the impactingReasons property: Reasons impacting health state. + * + * @return the impactingReasons value. + */ + public String impactingReasons() { + return this.impactingReasons; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedRGConfiguration.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedRGConfiguration.java new file mode 100644 index 000000000000..f03f51235a78 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedRGConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed resource group configuration. */ +@Fluent +public final class ManagedRGConfiguration { + /* + * Managed resource group name + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of ManagedRGConfiguration class. */ + public ManagedRGConfiguration() { + } + + /** + * Get the name property: Managed resource group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Managed resource group name. + * + * @param name the name value to set. + * @return the ManagedRGConfiguration object itself. + */ + public ManagedRGConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentity.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..49e35aadc0e1 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentity.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** The Managed service identity. */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /* + * The managed service identity for all identities. + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Get the type property: The managed service identity for all identities. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The managed service identity for all identities. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentityType.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..fc0944fa2dfd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ManagedServiceIdentityType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The managed service identity for all identities. */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitor.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitor.java new file mode 100644 index 000000000000..9b0c72d062dc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitor.java @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner; +import java.util.Map; + +/** An immutable client-side representation of Monitor. */ +public interface Monitor { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: The Managed service identity. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: State of provisioning of the SAP monitor. + * + * @return the provisioningState value. + */ + WorkloadMonitorProvisioningState provisioningState(); + + /** + * Gets the errors property: Defines the SAP monitor errors. + * + * @return the errors value. + */ + MonitorPropertiesErrors errors(); + + /** + * Gets the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The + * subnet region should be same as the SAP monitoring region. + * + * @return the appLocation value. + */ + String appLocation(); + + /** + * Gets the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918 + * traffic is routed to the customer VNET. + * + * @return the routingPreference value. + */ + RoutingPreference routingPreference(); + + /** + * Gets the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the + * SAP monitor. By default resources will be created which do not support zone redundancy. + * + * @return the zoneRedundancyPreference value. + */ + String zoneRedundancyPreference(); + + /** + * Gets the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + ManagedRGConfiguration managedResourceGroupConfiguration(); + + /** + * Gets the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. + * + * @return the logAnalyticsWorkspaceArmId value. + */ + String logAnalyticsWorkspaceArmId(); + + /** + * Gets the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @return the monitorSubnet value. + */ + String monitorSubnet(); + + /** + * Gets the msiArmId property: The ARM ID of the MSI used for SAP monitoring. + * + * @return the msiArmId value. + */ + String msiArmId(); + + /** + * Gets the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring. + * + * @return the storageAccountArmId value. + */ + String storageAccountArmId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner object. + * + * @return the inner object. + */ + MonitorInner innerModel(); + + /** The entirety of the Monitor definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The Monitor definition stages. */ + interface DefinitionStages { + /** The first stage of the Monitor definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the Monitor 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); + } + + /** The stage of the Monitor definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Monitor 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.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithAppLocation, + DefinitionStages.WithRoutingPreference, + DefinitionStages.WithZoneRedundancyPreference, + DefinitionStages.WithManagedResourceGroupConfiguration, + DefinitionStages.WithLogAnalyticsWorkspaceArmId, + DefinitionStages.WithMonitorSubnet { + /** + * Executes the create request. + * + * @return the created resource. + */ + Monitor create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Monitor create(Context context); + } + + /** The stage of the Monitor definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the Monitor definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The Managed service identity.. + * + * @param identity The Managed service identity. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** The stage of the Monitor definition allowing to specify appLocation. */ + interface WithAppLocation { + /** + * Specifies the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring + * region. The subnet region should be same as the SAP monitoring region.. + * + * @param appLocation The SAP monitor resources will be deployed in the SAP monitoring region. The subnet + * region should be same as the SAP monitoring region. + * @return the next definition stage. + */ + WithCreate withAppLocation(String appLocation); + } + + /** The stage of the Monitor definition allowing to specify routingPreference. */ + interface WithRoutingPreference { + /** + * Specifies the routingPreference property: Sets the routing preference of the SAP monitor. By default only + * RFC1918 traffic is routed to the customer VNET.. + * + * @param routingPreference Sets the routing preference of the SAP monitor. By default only RFC1918 traffic + * is routed to the customer VNET. + * @return the next definition stage. + */ + WithCreate withRoutingPreference(RoutingPreference routingPreference); + } + + /** The stage of the Monitor definition allowing to specify zoneRedundancyPreference. */ + interface WithZoneRedundancyPreference { + /** + * Specifies the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources + * created for the SAP monitor. By default resources will be created which do not support zone redundancy.. + * + * @param zoneRedundancyPreference Sets the preference for zone redundancy on resources created for the SAP + * monitor. By default resources will be created which do not support zone redundancy. + * @return the next definition stage. + */ + WithCreate withZoneRedundancyPreference(String zoneRedundancyPreference); + } + + /** The stage of the Monitor definition allowing to specify managedResourceGroupConfiguration. */ + interface WithManagedResourceGroupConfiguration { + /** + * Specifies the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration Managed resource group configuration. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration); + } + + /** The stage of the Monitor definition allowing to specify logAnalyticsWorkspaceArmId. */ + interface WithLogAnalyticsWorkspaceArmId { + /** + * Specifies the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used + * for SAP monitoring.. + * + * @param logAnalyticsWorkspaceArmId The ARM ID of the Log Analytics Workspace that is used for SAP + * monitoring. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId); + } + + /** The stage of the Monitor definition allowing to specify monitorSubnet. */ + interface WithMonitorSubnet { + /** + * Specifies the monitorSubnet property: The subnet which the SAP monitor will be deployed in. + * + * @param monitorSubnet The subnet which the SAP monitor will be deployed in. + * @return the next definition stage. + */ + WithCreate withMonitorSubnet(String monitorSubnet); + } + } + + /** + * Begins update for the Monitor resource. + * + * @return the stage of resource update. + */ + Monitor.Update update(); + + /** The template for Monitor update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Monitor apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Monitor apply(Context context); + } + + /** The Monitor update stages. */ + interface UpdateStages { + /** The stage of the Monitor update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the Resource tags.. + * + * @param tags Gets or sets the Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the Monitor update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The Managed service identity.. + * + * @param identity The Managed service identity. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Monitor refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Monitor refresh(Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorListResult.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorListResult.java new file mode 100644 index 000000000000..381056d5708e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List SAP monitors operation. */ +@Fluent +public final class MonitorListResult { + /* + * The list of SAP monitors. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of SAP monitors. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of MonitorListResult class. */ + public MonitorListResult() { + } + + /** + * Get the value property: The list of SAP monitors. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of SAP monitors. + * + * @param value the value value to set. + * @return the MonitorListResult object itself. + */ + public MonitorListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of SAP monitors. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of SAP monitors. + * + * @param nextLink the nextLink value to set. + * @return the MonitorListResult object itself. + */ + public MonitorListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorPropertiesErrors.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorPropertiesErrors.java new file mode 100644 index 000000000000..1596d083c764 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MonitorPropertiesErrors.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; + +/** Defines the SAP monitor errors. */ +@Immutable +public final class MonitorPropertiesErrors extends Error { + /** Creates an instance of MonitorPropertiesErrors class. */ + public MonitorPropertiesErrors() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitors.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitors.java new file mode 100644 index 000000000000..bfed410faf3d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Monitors.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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 Monitors. */ +public interface Monitors { + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of SAP monitors in the specified subscription. + * + *

Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each + * SAP monitor. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP monitors in the specified subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of SAP monitors + * + *

Gets a list of SAP monitors in the specified 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 a list of SAP monitors in the specified resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name. + */ + Monitor getByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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. + */ + void delete(String resourceGroupName, String monitorName, Context context); + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + Monitor getById(String id); + + /** + * Gets properties of a SAP monitor. + * + *

Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a SAP monitor for the specified subscription, resource group, and resource name along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a SAP monitor. + * + *

Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Monitor resource. + * + * @param name resource name. + * @return the first stage of the new Monitor definition. + */ + Monitor.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MsSqlServerProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MsSqlServerProviderInstanceProperties.java new file mode 100644 index 000000000000..77cb37cf6133 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/MsSqlServerProviderInstanceProperties.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Gets or sets the SQL server provider properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") +@JsonTypeName("MsSqlServer") +@Fluent +public final class MsSqlServerProviderInstanceProperties extends ProviderSpecificProperties { + /* + * Gets or sets the SQL server host name. + */ + @JsonProperty(value = "hostname") + private String hostname; + + /* + * Gets or sets the database sql port. + */ + @JsonProperty(value = "dbPort") + private String dbPort; + + /* + * Gets or sets the database user name. + */ + @JsonProperty(value = "dbUsername") + private String dbUsername; + + /* + * Gets or sets the database password. + */ + @JsonProperty(value = "dbPassword") + private String dbPassword; + + /* + * Gets or sets the key vault URI to secret with the database password. + */ + @JsonProperty(value = "dbPasswordUri") + private String dbPasswordUri; + + /* + * Gets or sets the SAP System Identifier + */ + @JsonProperty(value = "sapSid") + private String sapSid; + + /* + * Gets or sets certificate preference if secure communication is enabled. + */ + @JsonProperty(value = "sslPreference") + private SslPreference sslPreference; + + /* + * Gets or sets the blob URI to SSL certificate for the SQL Database. + */ + @JsonProperty(value = "sslCertificateUri") + private String sslCertificateUri; + + /** Creates an instance of MsSqlServerProviderInstanceProperties class. */ + public MsSqlServerProviderInstanceProperties() { + } + + /** + * Get the hostname property: Gets or sets the SQL server host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Gets or sets the SQL server host name. + * + * @param hostname the hostname value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the dbPort property: Gets or sets the database sql port. + * + * @return the dbPort value. + */ + public String dbPort() { + return this.dbPort; + } + + /** + * Set the dbPort property: Gets or sets the database sql port. + * + * @param dbPort the dbPort value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withDbPort(String dbPort) { + this.dbPort = dbPort; + return this; + } + + /** + * Get the dbUsername property: Gets or sets the database user name. + * + * @return the dbUsername value. + */ + public String dbUsername() { + return this.dbUsername; + } + + /** + * Set the dbUsername property: Gets or sets the database user name. + * + * @param dbUsername the dbUsername value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withDbUsername(String dbUsername) { + this.dbUsername = dbUsername; + return this; + } + + /** + * Get the dbPassword property: Gets or sets the database password. + * + * @return the dbPassword value. + */ + public String dbPassword() { + return this.dbPassword; + } + + /** + * Set the dbPassword property: Gets or sets the database password. + * + * @param dbPassword the dbPassword value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withDbPassword(String dbPassword) { + this.dbPassword = dbPassword; + return this; + } + + /** + * Get the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. + * + * @return the dbPasswordUri value. + */ + public String dbPasswordUri() { + return this.dbPasswordUri; + } + + /** + * Set the dbPasswordUri property: Gets or sets the key vault URI to secret with the database password. + * + * @param dbPasswordUri the dbPasswordUri value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withDbPasswordUri(String dbPasswordUri) { + this.dbPasswordUri = dbPasswordUri; + return this; + } + + /** + * Get the sapSid property: Gets or sets the SAP System Identifier. + * + * @return the sapSid value. + */ + public String sapSid() { + return this.sapSid; + } + + /** + * Set the sapSid property: Gets or sets the SAP System Identifier. + * + * @param sapSid the sapSid value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withSapSid(String sapSid) { + this.sapSid = sapSid; + return this; + } + + /** + * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @return the sslPreference value. + */ + public SslPreference sslPreference() { + return this.sslPreference; + } + + /** + * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @param sslPreference the sslPreference value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withSslPreference(SslPreference sslPreference) { + this.sslPreference = sslPreference; + return this; + } + + /** + * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the SQL Database. + * + * @return the sslCertificateUri value. + */ + public String sslCertificateUri() { + return this.sslCertificateUri; + } + + /** + * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the SQL Database. + * + * @param sslCertificateUri the sslCertificateUri value to set. + * @return the MsSqlServerProviderInstanceProperties object itself. + */ + public MsSqlServerProviderInstanceProperties withSslCertificateUri(String sslCertificateUri) { + this.sslCertificateUri = sslCertificateUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operation.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operation.java new file mode 100644 index 000000000000..3db6e2c3d9ed --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface 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 isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: 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. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationDisplay.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationDisplay.java new file mode 100644 index 000000000000..74915969cdfc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public 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() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationListResult.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationListResult.java new file mode 100644 index 000000000000..5abcaf3e452b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operations.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operations.java new file mode 100644 index 000000000000..2d8de8bcdd7c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all the available API operations under this PR. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDefinitionDisplay.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDefinitionDisplay.java new file mode 100644 index 000000000000..b5fa1ffc4965 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDefinitionDisplay.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; + +/** Display information of the operation. */ +@Fluent +public final class OperationsDefinitionDisplay extends OperationsDisplayDefinition { + /** Creates an instance of OperationsDefinitionDisplay class. */ + public OperationsDefinitionDisplay() { + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withProvider(String provider) { + super.withProvider(provider); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withResource(String resource) { + super.withResource(resource); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withOperation(String operation) { + super.withOperation(operation); + return this; + } + + /** {@inheritDoc} */ + @Override + public OperationsDefinitionDisplay withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDisplayDefinition.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDisplayDefinition.java new file mode 100644 index 000000000000..a2d8b504e503 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/OperationsDisplayDefinition.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the workload operation. */ +@Fluent +public class OperationsDisplayDefinition { + /* + * Defines the workload provider. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * Defines the workload resource. + */ + @JsonProperty(value = "resource", required = true) + private String resource; + + /* + * Defines the workload operation. + */ + @JsonProperty(value = "operation", required = true) + private String operation; + + /* + * Describes the workload operation. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** Creates an instance of OperationsDisplayDefinition class. */ + public OperationsDisplayDefinition() { + } + + /** + * Get the provider property: Defines the workload provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Defines the workload provider. + * + * @param provider the provider value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Defines the workload resource. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Defines the workload resource. + * + * @param resource the resource value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Defines the workload operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Defines the workload operation. + * + * @param operation the operation value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Describes the workload operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Describes the workload operation. + * + * @param description the description value to set. + * @return the OperationsDisplayDefinition object itself. + */ + public OperationsDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property provider in model OperationsDisplayDefinition")); + } + if (resource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resource in model OperationsDisplayDefinition")); + } + if (operation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operation in model OperationsDisplayDefinition")); + } + if (description() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model OperationsDisplayDefinition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsDisplayDefinition.class); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Origin.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Origin.java new file mode 100644 index 000000000000..a1f30e0a506e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/Origin.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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 { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + 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. + */ + @JsonCreator + 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/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusHaClusterProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusHaClusterProviderInstanceProperties.java new file mode 100644 index 000000000000..51056ec6d8be --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusHaClusterProviderInstanceProperties.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Gets or sets the PrometheusHaCluster provider properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") +@JsonTypeName("PrometheusHaCluster") +@Fluent +public final class PrometheusHaClusterProviderInstanceProperties extends ProviderSpecificProperties { + /* + * URL of the Node Exporter endpoint. + */ + @JsonProperty(value = "prometheusUrl") + private String prometheusUrl; + + /* + * Gets or sets the target machine name. + */ + @JsonProperty(value = "hostname") + private String hostname; + + /* + * Gets or sets the cluster sid. + */ + @JsonProperty(value = "sid") + private String sid; + + /* + * Gets or sets the clusterName. + */ + @JsonProperty(value = "clusterName") + private String clusterName; + + /* + * Gets or sets certificate preference if secure communication is enabled. + */ + @JsonProperty(value = "sslPreference") + private SslPreference sslPreference; + + /* + * Gets or sets the blob URI to SSL certificate for the HA cluster exporter. + */ + @JsonProperty(value = "sslCertificateUri") + private String sslCertificateUri; + + /** Creates an instance of PrometheusHaClusterProviderInstanceProperties class. */ + public PrometheusHaClusterProviderInstanceProperties() { + } + + /** + * Get the prometheusUrl property: URL of the Node Exporter endpoint. + * + * @return the prometheusUrl value. + */ + public String prometheusUrl() { + return this.prometheusUrl; + } + + /** + * Set the prometheusUrl property: URL of the Node Exporter endpoint. + * + * @param prometheusUrl the prometheusUrl value to set. + * @return the PrometheusHaClusterProviderInstanceProperties object itself. + */ + public PrometheusHaClusterProviderInstanceProperties withPrometheusUrl(String prometheusUrl) { + this.prometheusUrl = prometheusUrl; + return this; + } + + /** + * Get the hostname property: Gets or sets the target machine name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Gets or sets the target machine name. + * + * @param hostname the hostname value to set. + * @return the PrometheusHaClusterProviderInstanceProperties object itself. + */ + public PrometheusHaClusterProviderInstanceProperties withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the sid property: Gets or sets the cluster sid. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Set the sid property: Gets or sets the cluster sid. + * + * @param sid the sid value to set. + * @return the PrometheusHaClusterProviderInstanceProperties object itself. + */ + public PrometheusHaClusterProviderInstanceProperties withSid(String sid) { + this.sid = sid; + return this; + } + + /** + * Get the clusterName property: Gets or sets the clusterName. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: Gets or sets the clusterName. + * + * @param clusterName the clusterName value to set. + * @return the PrometheusHaClusterProviderInstanceProperties object itself. + */ + public PrometheusHaClusterProviderInstanceProperties withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @return the sslPreference value. + */ + public SslPreference sslPreference() { + return this.sslPreference; + } + + /** + * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @param sslPreference the sslPreference value to set. + * @return the PrometheusHaClusterProviderInstanceProperties object itself. + */ + public PrometheusHaClusterProviderInstanceProperties withSslPreference(SslPreference sslPreference) { + this.sslPreference = sslPreference; + return this; + } + + /** + * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the HA cluster exporter. + * + * @return the sslCertificateUri value. + */ + public String sslCertificateUri() { + return this.sslCertificateUri; + } + + /** + * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the HA cluster exporter. + * + * @param sslCertificateUri the sslCertificateUri value to set. + * @return the PrometheusHaClusterProviderInstanceProperties object itself. + */ + public PrometheusHaClusterProviderInstanceProperties withSslCertificateUri(String sslCertificateUri) { + this.sslCertificateUri = sslCertificateUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusOSProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusOSProviderInstanceProperties.java new file mode 100644 index 000000000000..362711866480 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/PrometheusOSProviderInstanceProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Gets or sets the PrometheusOS provider properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") +@JsonTypeName("PrometheusOS") +@Fluent +public final class PrometheusOSProviderInstanceProperties extends ProviderSpecificProperties { + /* + * URL of the Node Exporter endpoint + */ + @JsonProperty(value = "prometheusUrl") + private String prometheusUrl; + + /* + * Gets or sets certificate preference if secure communication is enabled. + */ + @JsonProperty(value = "sslPreference") + private SslPreference sslPreference; + + /* + * Gets or sets the blob URI to SSL certificate for the prometheus node exporter. + */ + @JsonProperty(value = "sslCertificateUri") + private String sslCertificateUri; + + /* + * Gets or sets the SAP System Identifier + */ + @JsonProperty(value = "sapSid") + private String sapSid; + + /** Creates an instance of PrometheusOSProviderInstanceProperties class. */ + public PrometheusOSProviderInstanceProperties() { + } + + /** + * Get the prometheusUrl property: URL of the Node Exporter endpoint. + * + * @return the prometheusUrl value. + */ + public String prometheusUrl() { + return this.prometheusUrl; + } + + /** + * Set the prometheusUrl property: URL of the Node Exporter endpoint. + * + * @param prometheusUrl the prometheusUrl value to set. + * @return the PrometheusOSProviderInstanceProperties object itself. + */ + public PrometheusOSProviderInstanceProperties withPrometheusUrl(String prometheusUrl) { + this.prometheusUrl = prometheusUrl; + return this; + } + + /** + * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @return the sslPreference value. + */ + public SslPreference sslPreference() { + return this.sslPreference; + } + + /** + * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @param sslPreference the sslPreference value to set. + * @return the PrometheusOSProviderInstanceProperties object itself. + */ + public PrometheusOSProviderInstanceProperties withSslPreference(SslPreference sslPreference) { + this.sslPreference = sslPreference; + return this; + } + + /** + * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the prometheus node + * exporter. + * + * @return the sslCertificateUri value. + */ + public String sslCertificateUri() { + return this.sslCertificateUri; + } + + /** + * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the prometheus node + * exporter. + * + * @param sslCertificateUri the sslCertificateUri value to set. + * @return the PrometheusOSProviderInstanceProperties object itself. + */ + public PrometheusOSProviderInstanceProperties withSslCertificateUri(String sslCertificateUri) { + this.sslCertificateUri = sslCertificateUri; + return this; + } + + /** + * Get the sapSid property: Gets or sets the SAP System Identifier. + * + * @return the sapSid value. + */ + public String sapSid() { + return this.sapSid; + } + + /** + * Set the sapSid property: Gets or sets the SAP System Identifier. + * + * @param sapSid the sapSid value to set. + * @return the PrometheusOSProviderInstanceProperties object itself. + */ + public PrometheusOSProviderInstanceProperties withSapSid(String sapSid) { + this.sapSid = sapSid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstance.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstance.java new file mode 100644 index 000000000000..7ae1eaa56685 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstance.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner; + +/** An immutable client-side representation of ProviderInstance. */ +public interface ProviderInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: State of provisioning of the provider instance. + * + * @return the provisioningState value. + */ + WorkloadMonitorProvisioningState provisioningState(); + + /** + * Gets the health property: Resource health details. + * + * @return the health value. + */ + Health health(); + + /** + * Gets the errors property: Defines the provider instance errors. + * + * @return the errors value. + */ + ProviderInstancePropertiesErrors errors(); + + /** + * Gets the providerSettings property: Defines the provider specific properties. + * + * @return the providerSettings value. + */ + ProviderSpecificProperties providerSettings(); + + /** + * Gets the inner com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner + * object. + * + * @return the inner object. + */ + ProviderInstanceInner innerModel(); + + /** The entirety of the ProviderInstance definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ProviderInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the ProviderInstance definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ProviderInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, monitorName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @return the next definition stage. + */ + WithCreate withExistingMonitor(String resourceGroupName, String monitorName); + } + + /** + * The stage of the ProviderInstance 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.WithProviderSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProviderInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProviderInstance create(Context context); + } + + /** The stage of the ProviderInstance definition allowing to specify providerSettings. */ + interface WithProviderSettings { + /** + * Specifies the providerSettings property: Defines the provider specific properties.. + * + * @param providerSettings Defines the provider specific properties. + * @return the next definition stage. + */ + WithCreate withProviderSettings(ProviderSpecificProperties providerSettings); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProviderInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProviderInstance refresh(Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstanceListResult.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstanceListResult.java new file mode 100644 index 000000000000..fa762e347b43 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstanceListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List provider instances operation. */ +@Fluent +public final class ProviderInstanceListResult { + /* + * The list of provider instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of provider instances. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ProviderInstanceListResult class. */ + public ProviderInstanceListResult() { + } + + /** + * Get the value property: The list of provider instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of provider instances. + * + * @param value the value value to set. + * @return the ProviderInstanceListResult object itself. + */ + public ProviderInstanceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of provider instances. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of provider instances. + * + * @param nextLink the nextLink value to set. + * @return the ProviderInstanceListResult object itself. + */ + public ProviderInstanceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstancePropertiesErrors.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstancePropertiesErrors.java new file mode 100644 index 000000000000..c4f87d89019f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstancePropertiesErrors.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; + +/** Defines the provider instance errors. */ +@Immutable +public final class ProviderInstancePropertiesErrors extends Error { + /** Creates an instance of ProviderInstancePropertiesErrors class. */ + public ProviderInstancePropertiesErrors() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstances.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstances.java new file mode 100644 index 000000000000..c08b1b07df14 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderInstances.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.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 ProviderInstances. */ +public interface ProviderInstances { + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName); + + /** + * Gets a list of provider instances in the specified SAP monitor. + * + *

Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of + * each provider instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 a list of provider instances in the specified SAP monitor as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String monitorName, Context context); + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String monitorName, String providerInstanceName, Context context); + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + */ + ProviderInstance get(String resourceGroupName, String monitorName, String providerInstanceName); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, String providerInstanceName); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param providerInstanceName Name of the provider instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String monitorName, String providerInstanceName, Context context); + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response}. + */ + ProviderInstance getById(String id); + + /** + * Gets properties of a provider instance. + * + *

Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of a provider instance for the specified subscription, resource group, SAP monitor name, and + * resource name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a provider instance. + * + *

Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource + * name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProviderInstance resource. + * + * @param name resource name. + * @return the first stage of the new ProviderInstance definition. + */ + ProviderInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderSpecificProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderSpecificProperties.java new file mode 100644 index 000000000000..1ff54797f4ec --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/ProviderSpecificProperties.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Gets or sets the provider specific properties. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "providerType", + defaultImpl = ProviderSpecificProperties.class) +@JsonTypeName("ProviderSpecificProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SapHana", value = HanaDbProviderInstanceProperties.class), + @JsonSubTypes.Type(name = "SapNetWeaver", value = SapNetWeaverProviderInstanceProperties.class), + @JsonSubTypes.Type(name = "PrometheusOS", value = PrometheusOSProviderInstanceProperties.class), + @JsonSubTypes.Type(name = "Db2", value = DB2ProviderInstanceProperties.class), + @JsonSubTypes.Type(name = "PrometheusHaCluster", value = PrometheusHaClusterProviderInstanceProperties.class), + @JsonSubTypes.Type(name = "MsSqlServer", value = MsSqlServerProviderInstanceProperties.class) +}) +@Immutable +public class ProviderSpecificProperties { + /** Creates an instance of ProviderSpecificProperties class. */ + public ProviderSpecificProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/RoutingPreference.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/RoutingPreference.java new file mode 100644 index 000000000000..ea8f3a5629b3 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/RoutingPreference.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. */ +public final class RoutingPreference extends ExpandableStringEnum { + /** Static value Default for RoutingPreference. */ + public static final RoutingPreference DEFAULT = fromString("Default"); + + /** Static value RouteAll for RoutingPreference. */ + public static final RoutingPreference ROUTE_ALL = fromString("RouteAll"); + + /** + * Creates a new instance of RoutingPreference value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingPreference() { + } + + /** + * Creates or finds a RoutingPreference from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingPreference. + */ + @JsonCreator + public static RoutingPreference fromString(String name) { + return fromString(name, RoutingPreference.class); + } + + /** + * Gets known RoutingPreference values. + * + * @return known RoutingPreference values. + */ + public static Collection values() { + return values(RoutingPreference.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitor.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitor.java new file mode 100644 index 000000000000..3e1355b27b62 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitor.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import java.util.List; + +/** An immutable client-side representation of SapLandscapeMonitor. */ +public interface SapLandscapeMonitor { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: State of provisioning of the SAP monitor. + * + * @return the provisioningState value. + */ + SapLandscapeMonitorProvisioningState provisioningState(); + + /** + * Gets the grouping property: Gets or sets the SID groupings by landscape and Environment. + * + * @return the grouping value. + */ + SapLandscapeMonitorPropertiesGrouping grouping(); + + /** + * Gets the topMetricsThresholds property: Gets or sets the list Top Metric Thresholds for SAP Landscape Monitor + * Dashboard. + * + * @return the topMetricsThresholds value. + */ + List topMetricsThresholds(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner object. + * + * @return the inner object. + */ + SapLandscapeMonitorInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorListResult.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorListResult.java new file mode 100644 index 000000000000..89672a8d67d0 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorListResult.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner; +import java.util.List; + +/** An immutable client-side representation of SapLandscapeMonitorListResult. */ +public interface SapLandscapeMonitorListResult { + /** + * Gets the value property: The list of Sap Landscape Monitor configuration. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to get the next set of SAP Landscape Monitor Dashboard. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner + * object. + * + * @return the inner object. + */ + SapLandscapeMonitorListResultInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorMetricThresholds.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorMetricThresholds.java new file mode 100644 index 000000000000..0b3452e71743 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorMetricThresholds.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the Threshold Values for Top Metrics Health. */ +@Fluent +public final class SapLandscapeMonitorMetricThresholds { + /* + * Gets or sets the name of the threshold. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the threshold value for Green. + */ + @JsonProperty(value = "green") + private Float green; + + /* + * Gets or sets the threshold value for Yellow. + */ + @JsonProperty(value = "yellow") + private Float yellow; + + /* + * Gets or sets the threshold value for Red. + */ + @JsonProperty(value = "red") + private Float red; + + /** Creates an instance of SapLandscapeMonitorMetricThresholds class. */ + public SapLandscapeMonitorMetricThresholds() { + } + + /** + * Get the name property: Gets or sets the name of the threshold. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the name of the threshold. + * + * @param name the name value to set. + * @return the SapLandscapeMonitorMetricThresholds object itself. + */ + public SapLandscapeMonitorMetricThresholds withName(String name) { + this.name = name; + return this; + } + + /** + * Get the green property: Gets or sets the threshold value for Green. + * + * @return the green value. + */ + public Float green() { + return this.green; + } + + /** + * Set the green property: Gets or sets the threshold value for Green. + * + * @param green the green value to set. + * @return the SapLandscapeMonitorMetricThresholds object itself. + */ + public SapLandscapeMonitorMetricThresholds withGreen(Float green) { + this.green = green; + return this; + } + + /** + * Get the yellow property: Gets or sets the threshold value for Yellow. + * + * @return the yellow value. + */ + public Float yellow() { + return this.yellow; + } + + /** + * Set the yellow property: Gets or sets the threshold value for Yellow. + * + * @param yellow the yellow value to set. + * @return the SapLandscapeMonitorMetricThresholds object itself. + */ + public SapLandscapeMonitorMetricThresholds withYellow(Float yellow) { + this.yellow = yellow; + return this; + } + + /** + * Get the red property: Gets or sets the threshold value for Red. + * + * @return the red value. + */ + public Float red() { + return this.red; + } + + /** + * Set the red property: Gets or sets the threshold value for Red. + * + * @param red the red value to set. + * @return the SapLandscapeMonitorMetricThresholds object itself. + */ + public SapLandscapeMonitorMetricThresholds withRed(Float red) { + this.red = red; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorPropertiesGrouping.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorPropertiesGrouping.java new file mode 100644 index 000000000000..6d51e267da29 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorPropertiesGrouping.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Gets or sets the SID groupings by landscape and Environment. */ +@Fluent +public final class SapLandscapeMonitorPropertiesGrouping { + /* + * Gets or sets the list of landscape to SID mappings. + */ + @JsonProperty(value = "landscape") + private List landscape; + + /* + * Gets or sets the list of Sap Applications to SID mappings. + */ + @JsonProperty(value = "sapApplication") + private List sapApplication; + + /** Creates an instance of SapLandscapeMonitorPropertiesGrouping class. */ + public SapLandscapeMonitorPropertiesGrouping() { + } + + /** + * Get the landscape property: Gets or sets the list of landscape to SID mappings. + * + * @return the landscape value. + */ + public List landscape() { + return this.landscape; + } + + /** + * Set the landscape property: Gets or sets the list of landscape to SID mappings. + * + * @param landscape the landscape value to set. + * @return the SapLandscapeMonitorPropertiesGrouping object itself. + */ + public SapLandscapeMonitorPropertiesGrouping withLandscape(List landscape) { + this.landscape = landscape; + return this; + } + + /** + * Get the sapApplication property: Gets or sets the list of Sap Applications to SID mappings. + * + * @return the sapApplication value. + */ + public List sapApplication() { + return this.sapApplication; + } + + /** + * Set the sapApplication property: Gets or sets the list of Sap Applications to SID mappings. + * + * @param sapApplication the sapApplication value to set. + * @return the SapLandscapeMonitorPropertiesGrouping object itself. + */ + public SapLandscapeMonitorPropertiesGrouping withSapApplication( + List sapApplication) { + this.sapApplication = sapApplication; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (landscape() != null) { + landscape().forEach(e -> e.validate()); + } + if (sapApplication() != null) { + sapApplication().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorProvisioningState.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorProvisioningState.java new file mode 100644 index 000000000000..135ad939b60c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorProvisioningState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of provisioning of the SAP monitor. */ +public final class SapLandscapeMonitorProvisioningState + extends ExpandableStringEnum { + /** Static value Accepted for SapLandscapeMonitorProvisioningState. */ + public static final SapLandscapeMonitorProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Created for SapLandscapeMonitorProvisioningState. */ + public static final SapLandscapeMonitorProvisioningState CREATED = fromString("Created"); + + /** Static value Failed for SapLandscapeMonitorProvisioningState. */ + public static final SapLandscapeMonitorProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for SapLandscapeMonitorProvisioningState. */ + public static final SapLandscapeMonitorProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for SapLandscapeMonitorProvisioningState. */ + public static final SapLandscapeMonitorProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of SapLandscapeMonitorProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapLandscapeMonitorProvisioningState() { + } + + /** + * Creates or finds a SapLandscapeMonitorProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapLandscapeMonitorProvisioningState. + */ + @JsonCreator + public static SapLandscapeMonitorProvisioningState fromString(String name) { + return fromString(name, SapLandscapeMonitorProvisioningState.class); + } + + /** + * Gets known SapLandscapeMonitorProvisioningState values. + * + * @return known SapLandscapeMonitorProvisioningState values. + */ + public static Collection values() { + return values(SapLandscapeMonitorProvisioningState.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorSidMapping.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorSidMapping.java new file mode 100644 index 000000000000..e854d4bb16eb --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitorSidMapping.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Gets or sets the mapping for SID to Environment/Applications. */ +@Fluent +public final class SapLandscapeMonitorSidMapping { + /* + * Gets or sets the name of the grouping. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets or sets the list of SID's. + */ + @JsonProperty(value = "topSid") + private List topSid; + + /** Creates an instance of SapLandscapeMonitorSidMapping class. */ + public SapLandscapeMonitorSidMapping() { + } + + /** + * Get the name property: Gets or sets the name of the grouping. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets or sets the name of the grouping. + * + * @param name the name value to set. + * @return the SapLandscapeMonitorSidMapping object itself. + */ + public SapLandscapeMonitorSidMapping withName(String name) { + this.name = name; + return this; + } + + /** + * Get the topSid property: Gets or sets the list of SID's. + * + * @return the topSid value. + */ + public List topSid() { + return this.topSid; + } + + /** + * Set the topSid property: Gets or sets the list of SID's. + * + * @param topSid the topSid value to set. + * @return the SapLandscapeMonitorSidMapping object itself. + */ + public SapLandscapeMonitorSidMapping withTopSid(List topSid) { + this.topSid = topSid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitors.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitors.java new file mode 100644 index 000000000000..2153682ec40d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapLandscapeMonitors.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; + +/** Resource collection API of SapLandscapeMonitors. */ +public interface SapLandscapeMonitors { + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + */ + SapLandscapeMonitor get(String resourceGroupName, String monitorName); + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard along with {@link Response}. + */ + Response createWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context); + + /** + * Creates a SAP Landscape Monitor Dashboard. + * + *

Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard. + */ + SapLandscapeMonitor create( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Deletes a SAP Landscape Monitor Dashboard. + * + *

Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String monitorName); + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard along with {@link Response}. + */ + Response updateWithResponse( + String resourceGroupName, + String monitorName, + SapLandscapeMonitorInner sapLandscapeMonitorParameter, + Context context); + + /** + * Patches the SAP Landscape Monitor Dashboard. + * + *

Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor + * name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @param sapLandscapeMonitorParameter Request body representing a configuration for Sap Landscape Monitor + * Dashboard. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 associated with SAP Landscape Monitor Dashboard. + */ + SapLandscapeMonitor update( + String resourceGroupName, String monitorName, SapLandscapeMonitorInner sapLandscapeMonitorParameter); + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor 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 configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String monitorName, Context context); + + /** + * Gets configuration values for Single Pane Of Glass for SAP monitor. + * + *

Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the SAP monitor resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 values for Single Pane Of Glass for SAP monitor for the specified subscription, resource + * group, and resource name. + */ + SapLandscapeMonitorListResult list(String resourceGroupName, String monitorName); +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapNetWeaverProviderInstanceProperties.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapNetWeaverProviderInstanceProperties.java new file mode 100644 index 000000000000..44b7f0fcd9a9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SapNetWeaverProviderInstanceProperties.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Gets or sets the provider properties. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "providerType") +@JsonTypeName("SapNetWeaver") +@Fluent +public final class SapNetWeaverProviderInstanceProperties extends ProviderSpecificProperties { + /* + * Gets or sets the SAP System Identifier + */ + @JsonProperty(value = "sapSid") + private String sapSid; + + /* + * Gets or sets the target virtual machine IP Address/FQDN. + */ + @JsonProperty(value = "sapHostname") + private String sapHostname; + + /* + * Gets or sets the instance number of SAP NetWeaver. + */ + @JsonProperty(value = "sapInstanceNr") + private String sapInstanceNr; + + /* + * Gets or sets the list of HostFile Entries + */ + @JsonProperty(value = "sapHostFileEntries") + private List sapHostFileEntries; + + /* + * Gets or sets the SAP user name. + */ + @JsonProperty(value = "sapUsername") + private String sapUsername; + + /* + * Sets the SAP password. + */ + @JsonProperty(value = "sapPassword") + private String sapPassword; + + /* + * Gets or sets the key vault URI to secret with the SAP password. + */ + @JsonProperty(value = "sapPasswordUri") + private String sapPasswordUri; + + /* + * Gets or sets the SAP Client ID. + */ + @JsonProperty(value = "sapClientId") + private String sapClientId; + + /* + * Gets or sets the SAP HTTP port number. + */ + @JsonProperty(value = "sapPortNumber") + private String sapPortNumber; + + /* + * Gets or sets the blob URI to SSL certificate for the SAP system. + */ + @JsonProperty(value = "sslCertificateUri") + private String sslCertificateUri; + + /* + * Gets or sets certificate preference if secure communication is enabled. + */ + @JsonProperty(value = "sslPreference") + private SslPreference sslPreference; + + /** Creates an instance of SapNetWeaverProviderInstanceProperties class. */ + public SapNetWeaverProviderInstanceProperties() { + } + + /** + * Get the sapSid property: Gets or sets the SAP System Identifier. + * + * @return the sapSid value. + */ + public String sapSid() { + return this.sapSid; + } + + /** + * Set the sapSid property: Gets or sets the SAP System Identifier. + * + * @param sapSid the sapSid value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapSid(String sapSid) { + this.sapSid = sapSid; + return this; + } + + /** + * Get the sapHostname property: Gets or sets the target virtual machine IP Address/FQDN. + * + * @return the sapHostname value. + */ + public String sapHostname() { + return this.sapHostname; + } + + /** + * Set the sapHostname property: Gets or sets the target virtual machine IP Address/FQDN. + * + * @param sapHostname the sapHostname value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapHostname(String sapHostname) { + this.sapHostname = sapHostname; + return this; + } + + /** + * Get the sapInstanceNr property: Gets or sets the instance number of SAP NetWeaver. + * + * @return the sapInstanceNr value. + */ + public String sapInstanceNr() { + return this.sapInstanceNr; + } + + /** + * Set the sapInstanceNr property: Gets or sets the instance number of SAP NetWeaver. + * + * @param sapInstanceNr the sapInstanceNr value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapInstanceNr(String sapInstanceNr) { + this.sapInstanceNr = sapInstanceNr; + return this; + } + + /** + * Get the sapHostFileEntries property: Gets or sets the list of HostFile Entries. + * + * @return the sapHostFileEntries value. + */ + public List sapHostFileEntries() { + return this.sapHostFileEntries; + } + + /** + * Set the sapHostFileEntries property: Gets or sets the list of HostFile Entries. + * + * @param sapHostFileEntries the sapHostFileEntries value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapHostFileEntries(List sapHostFileEntries) { + this.sapHostFileEntries = sapHostFileEntries; + return this; + } + + /** + * Get the sapUsername property: Gets or sets the SAP user name. + * + * @return the sapUsername value. + */ + public String sapUsername() { + return this.sapUsername; + } + + /** + * Set the sapUsername property: Gets or sets the SAP user name. + * + * @param sapUsername the sapUsername value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapUsername(String sapUsername) { + this.sapUsername = sapUsername; + return this; + } + + /** + * Get the sapPassword property: Sets the SAP password. + * + * @return the sapPassword value. + */ + public String sapPassword() { + return this.sapPassword; + } + + /** + * Set the sapPassword property: Sets the SAP password. + * + * @param sapPassword the sapPassword value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapPassword(String sapPassword) { + this.sapPassword = sapPassword; + return this; + } + + /** + * Get the sapPasswordUri property: Gets or sets the key vault URI to secret with the SAP password. + * + * @return the sapPasswordUri value. + */ + public String sapPasswordUri() { + return this.sapPasswordUri; + } + + /** + * Set the sapPasswordUri property: Gets or sets the key vault URI to secret with the SAP password. + * + * @param sapPasswordUri the sapPasswordUri value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapPasswordUri(String sapPasswordUri) { + this.sapPasswordUri = sapPasswordUri; + return this; + } + + /** + * Get the sapClientId property: Gets or sets the SAP Client ID. + * + * @return the sapClientId value. + */ + public String sapClientId() { + return this.sapClientId; + } + + /** + * Set the sapClientId property: Gets or sets the SAP Client ID. + * + * @param sapClientId the sapClientId value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapClientId(String sapClientId) { + this.sapClientId = sapClientId; + return this; + } + + /** + * Get the sapPortNumber property: Gets or sets the SAP HTTP port number. + * + * @return the sapPortNumber value. + */ + public String sapPortNumber() { + return this.sapPortNumber; + } + + /** + * Set the sapPortNumber property: Gets or sets the SAP HTTP port number. + * + * @param sapPortNumber the sapPortNumber value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSapPortNumber(String sapPortNumber) { + this.sapPortNumber = sapPortNumber; + return this; + } + + /** + * Get the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the SAP system. + * + * @return the sslCertificateUri value. + */ + public String sslCertificateUri() { + return this.sslCertificateUri; + } + + /** + * Set the sslCertificateUri property: Gets or sets the blob URI to SSL certificate for the SAP system. + * + * @param sslCertificateUri the sslCertificateUri value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSslCertificateUri(String sslCertificateUri) { + this.sslCertificateUri = sslCertificateUri; + return this; + } + + /** + * Get the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @return the sslPreference value. + */ + public SslPreference sslPreference() { + return this.sslPreference; + } + + /** + * Set the sslPreference property: Gets or sets certificate preference if secure communication is enabled. + * + * @param sslPreference the sslPreference value to set. + * @return the SapNetWeaverProviderInstanceProperties object itself. + */ + public SapNetWeaverProviderInstanceProperties withSslPreference(SslPreference sslPreference) { + this.sslPreference = sslPreference; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SslPreference.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SslPreference.java new file mode 100644 index 000000000000..19a52a779375 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/SslPreference.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets certificate preference if secure communication is enabled. */ +public final class SslPreference extends ExpandableStringEnum { + /** Static value Disabled for SslPreference. */ + public static final SslPreference DISABLED = fromString("Disabled"); + + /** Static value RootCertificate for SslPreference. */ + public static final SslPreference ROOT_CERTIFICATE = fromString("RootCertificate"); + + /** Static value ServerCertificate for SslPreference. */ + public static final SslPreference SERVER_CERTIFICATE = fromString("ServerCertificate"); + + /** + * Creates a new instance of SslPreference value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SslPreference() { + } + + /** + * Creates or finds a SslPreference from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslPreference. + */ + @JsonCreator + public static SslPreference fromString(String name) { + return fromString(name, SslPreference.class); + } + + /** + * Gets known SslPreference values. + * + * @return known SslPreference values. + */ + public static Collection values() { + return values(SslPreference.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UpdateMonitorRequest.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UpdateMonitorRequest.java new file mode 100644 index 000000000000..3e5a5a5e9775 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UpdateMonitorRequest.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP monitor resource. */ +@Fluent +public final class UpdateMonitorRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The Managed service identity. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /** Creates an instance of UpdateMonitorRequest class. */ + public UpdateMonitorRequest() { + } + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateMonitorRequest object itself. + */ + public UpdateMonitorRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The Managed service identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed service identity. + * + * @param identity the identity value to set. + * @return the UpdateMonitorRequest object itself. + */ + public UpdateMonitorRequest withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UserAssignedIdentity.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..ea88461fa386 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadMonitorProvisioningState.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadMonitorProvisioningState.java new file mode 100644 index 000000000000..2aaddb11c0e8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadMonitorProvisioningState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of provisioning of the SAP monitor. */ +public final class WorkloadMonitorProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Creating for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState DELETING = fromString("Deleting"); + + /** Static value Migrating for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState MIGRATING = fromString("Migrating"); + + /** Static value Canceled for WorkloadMonitorProvisioningState. */ + public static final WorkloadMonitorProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of WorkloadMonitorProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkloadMonitorProvisioningState() { + } + + /** + * Creates or finds a WorkloadMonitorProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadMonitorProvisioningState. + */ + @JsonCreator + public static WorkloadMonitorProvisioningState fromString(String name) { + return fromString(name, WorkloadMonitorProvisioningState.class); + } + + /** + * Gets known WorkloadMonitorProvisioningState values. + * + * @return known WorkloadMonitorProvisioningState values. + */ + public static Collection values() { + return values(WorkloadMonitorProvisioningState.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadProviderInstanceHealthState.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadProviderInstanceHealthState.java new file mode 100644 index 000000000000..9a301d8d7199 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/WorkloadProviderInstanceHealthState.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of health of the provider instance. */ +public final class WorkloadProviderInstanceHealthState + extends ExpandableStringEnum { + /** Static value Healthy for WorkloadProviderInstanceHealthState. */ + public static final WorkloadProviderInstanceHealthState HEALTHY = fromString("Healthy"); + + /** Static value Degraded for WorkloadProviderInstanceHealthState. */ + public static final WorkloadProviderInstanceHealthState DEGRADED = fromString("Degraded"); + + /** Static value Unavailable for WorkloadProviderInstanceHealthState. */ + public static final WorkloadProviderInstanceHealthState UNAVAILABLE = fromString("Unavailable"); + + /** Static value Unknown for WorkloadProviderInstanceHealthState. */ + public static final WorkloadProviderInstanceHealthState UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of WorkloadProviderInstanceHealthState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkloadProviderInstanceHealthState() { + } + + /** + * Creates or finds a WorkloadProviderInstanceHealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadProviderInstanceHealthState. + */ + @JsonCreator + public static WorkloadProviderInstanceHealthState fromString(String name) { + return fromString(name, WorkloadProviderInstanceHealthState.class); + } + + /** + * Gets known WorkloadProviderInstanceHealthState values. + * + * @return known WorkloadProviderInstanceHealthState values. + */ + public static Collection values() { + return values(WorkloadProviderInstanceHealthState.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/package-info.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/package-info.java new file mode 100644 index 000000000000..31d2a1afbac8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for WorkloadsClient. The workload SAP monitor Client. */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/package-info.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/package-info.java new file mode 100644 index 000000000000..30c3c9cdc1e6 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for WorkloadsClient. The workload SAP monitor Client. */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors; diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/module-info.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/module-info.java new file mode 100644 index 000000000000..e4365eeabb79 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors; + exports com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent; + exports com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models; + exports com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models; + + opens com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/proxy-config.json b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/proxy-config.json new file mode 100644 index 000000000000..cac09935e000 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.MonitorsClientImpl$MonitorsService" ], [ "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.ProviderInstancesClientImpl$ProviderInstancesService" ], [ "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.SapLandscapeMonitorsClientImpl$SapLandscapeMonitorsService" ], [ "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.implementation.OperationsClientImpl$OperationsService" ] ] \ No newline at end of file diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/reflect-config.json b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/reflect-config.json new file mode 100644 index 000000000000..7a9ba524f378 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/reflect-config.json @@ -0,0 +1,206 @@ +[ { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MonitorListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.MonitorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MonitorPropertiesErrors", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Error", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ErrorInnerError", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedRGConfiguration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UpdateMonitorRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstanceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.ProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Health", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderInstancePropertiesErrors", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ProviderSpecificProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorSidMapping", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorListResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationsDisplayDefinition", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.OperationsDefinitionDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.HanaDbProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapNetWeaverProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.PrometheusOSProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.DB2ProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.PrometheusHaClusterProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MsSqlServerProviderInstanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadMonitorProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.RoutingPreference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.WorkloadProviderInstanceHealthState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SslPreference", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsCreateSamples.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsCreateSamples.java new file mode 100644 index 000000000000..b983a8759d59 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsCreateSamples.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.RoutingPreference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors Create. */ +public final class MonitorsCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Create_UserAssignedIdentity.json + */ + /** + * Sample code: Create a SAP monitor with user assigned identity. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorWithUserAssignedIdentity( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity( + new ManagedServiceIdentity() + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userassignedmsi", + new UserAssignedIdentity())) + .withType(ManagedServiceIdentityType.USER_ASSIGNED)) + .withAppLocation("westus") + .withRoutingPreference(RoutingPreference.ROUTE_ALL) + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Create.json + */ + /** + * Sample code: Create a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withAppLocation("westus") + .withRoutingPreference(RoutingPreference.ROUTE_ALL) + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Create_Identity.json + */ + /** + * Sample code: Create a SAP monitor with system assigned identity. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorWithSystemAssignedIdentity( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .define("mySapMonitor") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withAppLocation("westus") + .withRoutingPreference(RoutingPreference.ROUTE_ALL) + .withManagedResourceGroupConfiguration(new ManagedRGConfiguration().withName("myManagedRg")) + .withLogAnalyticsWorkspaceArmId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace") + .withMonitorSubnet( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .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; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsDeleteSamples.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsDeleteSamples.java new file mode 100644 index 000000000000..1ce9443e3491 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for Monitors Delete. */ +public final class MonitorsDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deletesASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.monitors().delete("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsGetByResourceGroup.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsGetByResourceGroup.java new file mode 100644 index 000000000000..03d3c6249c06 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsGetByResourceGroup.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for Monitors GetByResourceGroup. */ +public final class MonitorsGetByResourceGroup { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListByResourceGrou.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListByResourceGrou.java new file mode 100644 index 000000000000..0561a73e6861 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListByResourceGrou.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for Monitors ListByResourceGroup. */ +public final class MonitorsListByResourceGrou { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_ListByRG.json + */ + /** + * Sample code: List all SAP monitors in a resource group. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void listAllSAPMonitorsInAResourceGroup( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.monitors().listByResourceGroup("example-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListSamples.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListSamples.java new file mode 100644 index 000000000000..9da957f807dd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for Monitors List. */ +public final class MonitorsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_List.json + */ + /** + * Sample code: List all SAP monitors in a subscription. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void listAllSAPMonitorsInASubscription( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.monitors().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsUpdateSamples.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsUpdateSamples.java new file mode 100644 index 000000000000..0402fcc4822e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/MonitorsUpdateSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentity; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.Monitor; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Monitors Update. */ +public final class MonitorsUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deleteTagsFieldOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + Monitor resource = + manager + .monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf()) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Monitors/monitors_PatchTags.json + */ + /** + * Sample code: Update Tags field of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void updateTagsFieldOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + Monitor resource = + manager + .monitors() + .getByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("testkey", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .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; + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/OperationsListSamples.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/OperationsListSamples.java new file mode 100644 index 000000000000..1b06348347ff --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/operations/preview/2023-10-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void operations( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesCreateSam.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesCreateSam.java new file mode 100644 index 000000000000..e35557d0734e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesCreateSam.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.DB2ProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.HanaDbProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.MsSqlServerProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.PrometheusHaClusterProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.PrometheusOSProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapNetWeaverProviderInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SslPreference; +import java.util.Arrays; + +/** Samples for ProviderInstances Create. */ +public final class ProviderInstancesCreateSam { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/MsSqlServerProviderInstance/MsSqlServerProviderInstance_Create.json + */ + /** + * Sample code: Create a MsSqlServer provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAMsSqlServerProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new MsSqlServerProviderInstanceProperties() + .withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Db2ProviderInstances/Db2ProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a Db2 provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createADb2ProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new DB2ProviderInstanceProperties() + .withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Create.json + */ + /** + * Sample code: Create a SAP monitor Hana provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorHanaProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new HanaDbProviderInstanceProperties() + .withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSapSid("SID")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/NetWeaverProviderInstances/NetWeaverProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a SAP monitor NetWeaver provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorNetWeaverProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new SapNetWeaverProviderInstanceProperties() + .withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/MsSqlServerProviderInstance/MsSqlServerProviderInstance_Create_Root_Certificate.json + */ + /** + * Sample code: Create a MsSqlServer provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAMsSqlServerProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new MsSqlServerProviderInstanceProperties() + .withHostname("hostname") + .withDbPort("5912") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("sid") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusHaClusterProviderInstances/PrometheusHaClusterProviderInstances_Create.json + */ + /** + * Sample code: Create a PrometheusHaCluster provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAPrometheusHaClusterProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusHaClusterProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withHostname("hostname") + .withSid("sid") + .withClusterName("clusterName") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusHaClusterProviderInstances/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a PrometheusHaCluster provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAPrometheusHaClusterProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusHaClusterProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withHostname("hostname") + .withSid("sid") + .withClusterName("clusterName") + .withSslPreference(SslPreference.ROOT_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Db2ProviderInstances/Db2ProviderInstances_Create.json + */ + /** + * Sample code: Create a Db2 provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createADb2Provider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new DB2ProviderInstanceProperties() + .withHostname("hostname") + .withDbName("dbName") + .withDbPort("dbPort") + .withDbUsername("username") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSapSid("SID") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusOSProviderInstances/PrometheusOSProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a OS provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAOSProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusOSProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withSslPreference(SslPreference.ROOT_CERTIFICATE) + .withSapSid("SID")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusOSProviderInstances/PrometheusOSProviderInstances_Create.json + */ + /** + * Sample code: Create a OS provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createAOSProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new PrometheusOSProviderInstanceProperties() + .withPrometheusUrl("http://192.168.0.0:9090/metrics") + .withSslPreference(SslPreference.SERVER_CERTIFICATE) + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSapSid("SID")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/NetWeaverProviderInstances/NetWeaverProviderInstances_Create.json + */ + /** + * Sample code: Create a SAP monitor NetWeaver provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorNetWeaverProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new SapNetWeaverProviderInstanceProperties() + .withSapSid("SID") + .withSapHostname("name") + .withSapInstanceNr("00") + .withSapHostFileEntries(Arrays.asList("127.0.0.1 name fqdn")) + .withSapUsername("username") + .withSapPassword("fakeTokenPlaceholder") + .withSapPasswordUri("fakeTokenPlaceholder") + .withSapClientId("111") + .withSapPortNumber("1234") + .withSslCertificateUri("https://storageaccount.blob.core.windows.net/containername/filename") + .withSslPreference(SslPreference.SERVER_CERTIFICATE)) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Create_Root_Certificate.json + */ + /** + * Sample code: Create a SAP monitor Hana provider with Root Certificate. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createASAPMonitorHanaProviderWithRootCertificate( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .define("myProviderInstance") + .withExistingMonitor("myResourceGroup", "mySapMonitor") + .withProviderSettings( + new HanaDbProviderInstanceProperties() + .withHostname("name") + .withDbName("db") + .withSqlPort("0000") + .withInstanceNumber("00") + .withDbUsername("user") + .withDbPassword("fakeTokenPlaceholder") + .withDbPasswordUri("fakeTokenPlaceholder") + .withSslHostnameInCertificate("xyz.domain.com") + .withSslPreference(SslPreference.ROOT_CERTIFICATE) + .withSapSid("SID")) + .create(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesDeleteSam.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesDeleteSam.java new file mode 100644 index 000000000000..63e22e756e47 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesDeleteSam.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for ProviderInstances Delete. */ +public final class ProviderInstancesDeleteSam { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Delete.json + */ + /** + * Sample code: Deletes a SAP monitor provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deletesASAPMonitorProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .delete("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesGetSamples.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesGetSamples.java new file mode 100644 index 000000000000..b2ee4af24a33 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesGetSamples.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for ProviderInstances Get. */ +public final class ProviderInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor Hana provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitorHanaProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusHaClusterProviderInstances/PrometheusHaClusterProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a PrometheusHaCluster provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfAPrometheusHaClusterProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/PrometheusOSProviderInstances/PrometheusOSProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a OS provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfAOSProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/Db2ProviderInstances/Db2ProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a Db2 provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfADb2Provider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/MsSqlServerProviderInstance/MsSqlServerProviderInstance_Get.json + */ + /** + * Sample code: Get properties of a MsSqlServer provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfAMsSqlServerProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/NetWeaverProviderInstances/NetWeaverProviderInstances_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor NetWeaver provider. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitorNetWeaverProvider( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .providerInstances() + .getWithResponse("myResourceGroup", "mySapMonitor", "myProviderInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesListSampl.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesListSampl.java new file mode 100644 index 000000000000..76f69f69d9f4 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/ProviderInstancesListSampl.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for ProviderInstances List. */ +public final class ProviderInstancesListSampl { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/ProviderInstances/ProviderInstances_List.json + */ + /** + * Sample code: List all SAP monitors providers in a subscription. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void listAllSAPMonitorsProvidersInASubscription( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager.providerInstances().list("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorCreateS.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorCreateS.java new file mode 100644 index 000000000000..08355c35c731 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorCreateS.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorSidMapping; +import java.util.Arrays; + +/** Samples for SapLandscapeMonitor Create. */ +public final class SapLandscapeMonitorCreateS { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Create.json + */ + /** + * Sample code: Create for SAP Landscape monitor Dashboard. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createForSAPLandscapeMonitorDashboard( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .createWithResponse( + "myResourceGroup", + "mySapMonitor", + new SapLandscapeMonitorInner() + .withGrouping( + new SapLandscapeMonitorPropertiesGrouping() + .withLandscape( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withTopMetricsThresholds( + Arrays + .asList( + new SapLandscapeMonitorMetricThresholds() + .withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorDeleteS.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorDeleteS.java new file mode 100644 index 000000000000..b52e418f69a7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorDeleteS.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for SapLandscapeMonitor Delete. */ +public final class SapLandscapeMonitorDeleteS { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Delete.json + */ + /** + * Sample code: Deletes SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void deletesSAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .deleteByResourceGroupWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorGetSamp.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorGetSamp.java new file mode 100644 index 000000000000..4bb0931b3740 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorGetSamp.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for SapLandscapeMonitor Get. */ +public final class SapLandscapeMonitorGetSamp { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Get.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .getWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorListSam.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorListSam.java new file mode 100644 index 000000000000..70599097be5b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorListSam.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +/** Samples for SapLandscapeMonitor List. */ +public final class SapLandscapeMonitorListSam { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_List.json + */ + /** + * Sample code: Get properties of a SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void getPropertiesOfASAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .listWithResponse("myResourceGroup", "mySapMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorUpdateS.java b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorUpdateS.java new file mode 100644 index 000000000000..6e1d9f29eebe --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadsmonitors/generated/SapLandscapeMonitorUpdateS.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.fluent.models.SapLandscapeMonitorInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorMetricThresholds; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorPropertiesGrouping; +import com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.models.SapLandscapeMonitorSidMapping; +import java.util.Arrays; + +/** Samples for SapLandscapeMonitor Update. */ +public final class SapLandscapeMonitorUpdateS { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/monitors/preview/2023-10-01-preview/examples/SapLandscapeMonitor/SapLandscapeMonitor_Update.json + */ + /** + * Sample code: Update SAP monitor. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void updateSAPMonitor( + com.azure.resourcemanager.workloadsmicrosoftworkloadsmonitors.WorkloadsManager manager) { + manager + .sapLandscapeMonitors() + .updateWithResponse( + "myResourceGroup", + "mySapMonitor", + new SapLandscapeMonitorInner() + .withGrouping( + new SapLandscapeMonitorPropertiesGrouping() + .withLandscape( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("Prod") + .withTopSid(Arrays.asList("SID1", "SID2")))) + .withSapApplication( + Arrays + .asList( + new SapLandscapeMonitorSidMapping() + .withName("ERP1") + .withTopSid(Arrays.asList("SID1", "SID2"))))) + .withTopMetricsThresholds( + Arrays + .asList( + new SapLandscapeMonitorMetricThresholds() + .withName("Instance Availability") + .withGreen(90.0F) + .withYellow(75.0F) + .withRed(50.0F))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/ci.yml b/sdk/workloadsmicrosoftworkloadsmonitors/ci.yml new file mode 100644 index 000000000000..8d2f662fbac6 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/workloadsmicrosoftworkloadsmonitors/ci.yml + - sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/ + exclude: + - sdk/workloadsmicrosoftworkloadsmonitors/pom.xml + - sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadsmicrosoftworkloadsmonitors/ci.yml + - sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/ + exclude: + - sdk/workloadsmicrosoftworkloadsmonitors/pom.xml + - sdk/workloadsmicrosoftworkloadsmonitors/azure-resourcemanager-workloadsmicrosoftworkloadsmonitors/pom.xml + +parameters: + - name: release_azureresourcemanagerworkloadsmicrosoftworkloadsmonitors + displayName: azure-resourcemanager-workloadsmicrosoftworkloadsmonitors + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: workloadsmicrosoftworkloadsmonitors + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-workloadsmicrosoftworkloadsmonitors + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerworkloadsmicrosoftworkloadsmonitors + releaseInBatch: ${{ parameters.release_azureresourcemanagerworkloadsmicrosoftworkloadsmonitors }} diff --git a/sdk/workloadsmicrosoftworkloadsmonitors/pom.xml b/sdk/workloadsmicrosoftworkloadsmonitors/pom.xml new file mode 100644 index 000000000000..b10b8a417e5d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadsmonitors/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-workloadsmicrosoftworkloadsmonitors-service + pom + 1.0.0 + + + azure-resourcemanager-workloadsmicrosoftworkloadsmonitors + +