From 979674d82d75d65639c97d21dd8bdacfbb8a8cbf Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 Apr 2021 05:44:19 +0000 Subject: [PATCH] CodeGen from PR 13879 in Azure/azure-rest-api-specs Merge 28c051b8d1a71c1b35a8df6a1332ab6cd2ba6845 into d27a2c457fac2b4e9ba642accf49757e63c973ea --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../azure-resourcemanager-avs/CHANGELOG.md | 5 + sdk/avs/azure-resourcemanager-avs/README.md | 99 + sdk/avs/azure-resourcemanager-avs/pom.xml | 67 + .../azure/resourcemanager/avs/AvsManager.java | 324 + .../avs/fluent/AddonsClient.java | 196 + .../avs/fluent/AuthorizationsClient.java | 213 + .../resourcemanager/avs/fluent/AvsClient.java | 116 + .../avs/fluent/ClustersClient.java | 273 + .../avs/fluent/DatastoresClient.java | 230 + .../fluent/GlobalReachConnectionsClient.java | 212 + .../avs/fluent/HcxEnterpriseSitesClient.java | 141 + .../avs/fluent/LocationsClient.java | 65 + .../avs/fluent/OperationsClient.java | 36 + .../avs/fluent/PrivateCloudsClient.java | 402 + .../avs/fluent/WorkloadNetworksClient.java | 1794 +++ .../avs/fluent/models/AddonInner.java | 96 + .../fluent/models/AdminCredentialsInner.java | 84 + .../avs/fluent/models/ClusterInner.java | 134 + .../avs/fluent/models/DatastoreInner.java | 103 + .../ExpressRouteAuthorizationInner.java | 73 + .../models/GlobalReachConnectionInner.java | 134 + .../fluent/models/HcxEnterpriseSiteInner.java | 58 + .../avs/fluent/models/OperationInner.java | 141 + .../avs/fluent/models/PrivateCloudInner.java | 391 + .../avs/fluent/models/QuotaInner.java | 56 + .../avs/fluent/models/TrialInner.java | 55 + .../models/WorkloadNetworkDhcpInner.java | 111 + .../WorkloadNetworkDnsServiceInner.java | 217 + .../models/WorkloadNetworkDnsZoneInner.java | 200 + .../models/WorkloadNetworkGatewayInner.java | 68 + .../WorkloadNetworkPortMirroringInner.java | 190 + .../models/WorkloadNetworkSegmentInner.java | 187 + .../models/WorkloadNetworkVMGroupInner.java | 138 + .../WorkloadNetworkVirtualMachineInner.java | 69 + .../avs/fluent/models/package-info.java | 6 + .../avs/fluent/package-info.java | 6 + .../avs/implementation/AddonImpl.java | 145 + .../avs/implementation/AddonsClientImpl.java | 1093 ++ .../avs/implementation/AddonsImpl.java | 187 + .../implementation/AdminCredentialsImpl.java | 43 + .../AuthorizationsClientImpl.java | 1156 ++ .../implementation/AuthorizationsImpl.java | 196 + .../avs/implementation/AvsClientBuilder.java | 145 + .../avs/implementation/AvsClientImpl.java | 419 + .../avs/implementation/ClusterImpl.java | 173 + .../implementation/ClustersClientImpl.java | 1418 +++ .../avs/implementation/ClustersImpl.java | 187 + .../avs/implementation/DatastoreImpl.java | 125 + .../implementation/DatastoresClientImpl.java | 1218 +++ .../avs/implementation/DatastoresImpl.java | 224 + .../ExpressRouteAuthorizationImpl.java | 138 + .../GlobalReachConnectionImpl.java | 159 + .../GlobalReachConnectionsClientImpl.java | 1179 ++ .../GlobalReachConnectionsImpl.java | 210 + .../implementation/HcxEnterpriseSiteImpl.java | 139 + .../HcxEnterpriseSitesClientImpl.java | 925 ++ .../HcxEnterpriseSitesImpl.java | 203 + .../implementation/LocationsClientImpl.java | 344 + .../avs/implementation/LocationsImpl.java | 82 + .../avs/implementation/OperationImpl.java | 49 + .../implementation/OperationsClientImpl.java | 269 + .../avs/implementation/OperationsImpl.java | 45 + .../avs/implementation/PrivateCloudImpl.java | 325 + .../PrivateCloudsClientImpl.java | 2206 ++++ .../avs/implementation/PrivateCloudsImpl.java | 211 + .../avs/implementation/QuotaImpl.java | 43 + .../avs/implementation/TrialImpl.java | 36 + .../avs/implementation/Utils.java | 204 + .../WorkloadNetworkDhcpImpl.java | 157 + .../WorkloadNetworkDnsServiceImpl.java | 195 + .../WorkloadNetworkDnsZoneImpl.java | 194 + .../WorkloadNetworkGatewayImpl.java | 48 + .../WorkloadNetworkPortMirroringImpl.java | 184 + .../WorkloadNetworkSegmentImpl.java | 182 + .../WorkloadNetworkVMGroupImpl.java | 167 + .../WorkloadNetworkVirtualMachineImpl.java | 49 + .../WorkloadNetworksClientImpl.java | 9664 +++++++++++++++++ .../implementation/WorkloadNetworksImpl.java | 1086 ++ .../avs/implementation/package-info.java | 6 + .../resourcemanager/avs/models/Addon.java | 183 + .../resourcemanager/avs/models/AddonList.java | 59 + .../avs/models/AddonProperties.java | 74 + .../avs/models/AddonProvisioningState.java | 46 + .../avs/models/AddonSrmProperties.java | 50 + .../resourcemanager/avs/models/AddonType.java | 34 + .../resourcemanager/avs/models/Addons.java | 142 + .../avs/models/AdminCredentials.java | 45 + .../avs/models/Authorizations.java | 142 + .../resourcemanager/avs/models/Circuit.java | 84 + .../resourcemanager/avs/models/Cluster.java | 191 + .../avs/models/ClusterList.java | 59 + .../avs/models/ClusterProperties.java | 32 + .../avs/models/ClusterProvisioningState.java | 43 + .../avs/models/ClusterUpdate.java | 52 + .../resourcemanager/avs/models/Clusters.java | 142 + .../avs/models/CommonClusterProperties.java | 96 + .../resourcemanager/avs/models/Datastore.java | 137 + .../avs/models/DatastoreList.java | 59 + .../models/DatastoreProvisioningState.java | 43 + .../avs/models/Datastores.java | 150 + .../avs/models/DhcpTypeEnum.java | 31 + .../avs/models/DiskPoolVolume.java | 77 + .../avs/models/DnsServiceLogLevelEnum.java | 43 + .../avs/models/DnsServiceStatusEnum.java | 34 + .../resourcemanager/avs/models/Endpoints.java | 69 + .../avs/models/ExpressRouteAuthorization.java | 143 + .../models/ExpressRouteAuthorizationList.java | 59 + ...ssRouteAuthorizationProvisioningState.java | 38 + .../avs/models/GlobalReachConnection.java | 209 + .../avs/models/GlobalReachConnectionList.java | 59 + ...lobalReachConnectionProvisioningState.java | 38 + .../models/GlobalReachConnectionStatus.java | 37 + .../avs/models/GlobalReachConnections.java | 142 + .../avs/models/HcxEnterpriseSite.java | 136 + .../avs/models/HcxEnterpriseSiteList.java | 59 + .../avs/models/HcxEnterpriseSiteStatus.java | 40 + .../avs/models/HcxEnterpriseSites.java | 145 + .../avs/models/IdentitySource.java | 290 + .../avs/models/InternetEnum.java | 34 + .../resourcemanager/avs/models/Locations.java | 57 + .../avs/models/LogSpecification.java | 102 + .../avs/models/ManagementCluster.java | 32 + .../avs/models/MetricDimension.java | 131 + .../avs/models/MetricSpecification.java | 375 + .../avs/models/NetAppVolume.java | 76 + .../resourcemanager/avs/models/Operation.java | 52 + .../avs/models/OperationDisplay.java | 84 + .../avs/models/OperationList.java | 59 + .../avs/models/OperationProperties.java | 53 + .../avs/models/Operations.java | 31 + .../models/PortMirroringDirectionEnum.java | 32 + .../avs/models/PortMirroringStatusEnum.java | 31 + .../avs/models/PrivateCloud.java | 486 + .../avs/models/PrivateCloudList.java | 59 + .../avs/models/PrivateCloudProperties.java | 278 + .../models/PrivateCloudProvisioningState.java | 49 + .../avs/models/PrivateCloudUpdate.java | 138 + .../models/PrivateCloudUpdateProperties.java | 109 + .../avs/models/PrivateClouds.java | 228 + .../resourcemanager/avs/models/Quota.java | 32 + .../avs/models/QuotaEnabled.java | 34 + .../avs/models/SegmentStatusEnum.java | 31 + .../avs/models/ServiceSpecification.java | 83 + .../azure/resourcemanager/avs/models/Sku.java | 54 + .../resourcemanager/avs/models/SslEnum.java | 34 + .../resourcemanager/avs/models/Trial.java | 31 + .../avs/models/TrialStatus.java | 37 + .../avs/models/VMGroupStatusEnum.java | 31 + .../avs/models/VMTypeEnum.java | 31 + .../avs/models/WorkloadNetworkDhcp.java | 191 + .../avs/models/WorkloadNetworkDhcpEntity.java | 120 + .../avs/models/WorkloadNetworkDhcpList.java | 59 + .../WorkloadNetworkDhcpProvisioningState.java | 44 + .../avs/models/WorkloadNetworkDhcpRelay.java | 71 + .../avs/models/WorkloadNetworkDhcpServer.java | 96 + .../avs/models/WorkloadNetworkDnsService.java | 311 + ...oadNetworkDnsServiceProvisioningState.java | 44 + .../WorkloadNetworkDnsServicesList.java | 59 + .../avs/models/WorkloadNetworkDnsZone.java | 304 + ...rkloadNetworkDnsZoneProvisioningState.java | 44 + .../models/WorkloadNetworkDnsZonesList.java | 59 + .../avs/models/WorkloadNetworkGateway.java | 52 + .../models/WorkloadNetworkGatewayList.java | 59 + .../models/WorkloadNetworkPortMirroring.java | 281 + .../WorkloadNetworkPortMirroringList.java | 59 + ...NetworkPortMirroringProvisioningState.java | 44 + .../avs/models/WorkloadNetworkSegment.java | 260 + .../models/WorkloadNetworkSegmentPortVif.java | 50 + ...rkloadNetworkSegmentProvisioningState.java | 44 + .../models/WorkloadNetworkSegmentSubnet.java | 77 + .../models/WorkloadNetworkSegmentsList.java | 59 + .../avs/models/WorkloadNetworkVMGroup.java | 219 + ...rkloadNetworkVMGroupProvisioningState.java | 44 + .../models/WorkloadNetworkVMGroupsList.java | 59 + .../models/WorkloadNetworkVirtualMachine.java | 52 + .../WorkloadNetworkVirtualMachinesList.java | 59 + .../avs/models/WorkloadNetworks.java | 908 ++ .../avs/models/package-info.java | 6 + .../resourcemanager/avs/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/avs/ci.yml | 33 + sdk/avs/pom.xml | 53 + 184 files changed, 42371 insertions(+) create mode 100644 sdk/avs/azure-resourcemanager-avs/CHANGELOG.md create mode 100644 sdk/avs/azure-resourcemanager-avs/README.md create mode 100644 sdk/avs/azure-resourcemanager-avs/pom.xml create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/Utils.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/LogSpecification.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricDimension.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricSpecification.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operations.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdateProperties.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ServiceSpecification.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java create mode 100644 sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java create mode 100644 sdk/avs/ci.yml create mode 100644 sdk/avs/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 95908ebb11bc..ded6136effd6 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -233,6 +233,7 @@ com.azure.resourcemanager:azure-resourcemanager-automation;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-resourcemover;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-datafactory;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-advisor;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-avs;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index aaad26c29259..60c5fb73798e 100644 --- a/pom.xml +++ b/pom.xml @@ -663,6 +663,7 @@ sdk/attestation sdk/authorization sdk/automation + sdk/avs sdk/batch sdk/boms sdk/changeanalysis diff --git a/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md new file mode 100644 index 000000000000..d210044c0a1f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-04-12) + +- Azure Resource Manager Avs client library for Java. This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2021-01-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/avs/azure-resourcemanager-avs/README.md b/sdk/avs/azure-resourcemanager-avs/README.md new file mode 100644 index 000000000000..1f53f7fc8a78 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager Avs client library for Java + +Azure Resource Manager Avs client library for Java. + +This package contains Microsoft Azure SDK for Avs Management SDK. Azure VMware Solution API. Package tag package-2021-01-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-avs;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-avs + 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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AvsManager manager = AvsManager + .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 + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/avs/azure-resourcemanager-avs/pom.xml b/sdk/avs/azure-resourcemanager-avs/pom.xml new file mode 100644 index 000000000000..fab5b3df813f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-avs + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Avs Management + This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2021-01-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 + + + + + com.azure + azure-core + 1.15.0 + + + com.azure + azure-core-management + 1.2.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java new file mode 100644 index 000000000000..482b8dcb3537 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/AvsManager.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs; + +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.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +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.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.AvsClient; +import com.azure.resourcemanager.avs.implementation.AddonsImpl; +import com.azure.resourcemanager.avs.implementation.AuthorizationsImpl; +import com.azure.resourcemanager.avs.implementation.AvsClientBuilder; +import com.azure.resourcemanager.avs.implementation.ClustersImpl; +import com.azure.resourcemanager.avs.implementation.DatastoresImpl; +import com.azure.resourcemanager.avs.implementation.GlobalReachConnectionsImpl; +import com.azure.resourcemanager.avs.implementation.HcxEnterpriseSitesImpl; +import com.azure.resourcemanager.avs.implementation.LocationsImpl; +import com.azure.resourcemanager.avs.implementation.OperationsImpl; +import com.azure.resourcemanager.avs.implementation.PrivateCloudsImpl; +import com.azure.resourcemanager.avs.implementation.WorkloadNetworksImpl; +import com.azure.resourcemanager.avs.models.Addons; +import com.azure.resourcemanager.avs.models.Authorizations; +import com.azure.resourcemanager.avs.models.Clusters; +import com.azure.resourcemanager.avs.models.Datastores; +import com.azure.resourcemanager.avs.models.GlobalReachConnections; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSites; +import com.azure.resourcemanager.avs.models.Locations; +import com.azure.resourcemanager.avs.models.Operations; +import com.azure.resourcemanager.avs.models.PrivateClouds; +import com.azure.resourcemanager.avs.models.WorkloadNetworks; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to AvsManager. Azure VMware Solution API. */ +public final class AvsManager { + private Operations operations; + + private Locations locations; + + private PrivateClouds privateClouds; + + private Clusters clusters; + + private Datastores datastores; + + private HcxEnterpriseSites hcxEnterpriseSites; + + private Authorizations authorizations; + + private GlobalReachConnections globalReachConnections; + + private WorkloadNetworks workloadNetworks; + + private Addons addons; + + private final AvsClient clientObject; + + private AvsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AvsClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Avs service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Avs service API instance. + */ + public static AvsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create AvsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AvsManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + 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; + } + + /** + * 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 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, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Avs service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Avs service API instance. + */ + public AvsManager 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.avs") + .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 (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AvsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Locations. */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** @return Resource collection API of PrivateClouds. */ + public PrivateClouds privateClouds() { + if (this.privateClouds == null) { + this.privateClouds = new PrivateCloudsImpl(clientObject.getPrivateClouds(), this); + } + return privateClouds; + } + + /** @return Resource collection API of Clusters. */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** @return Resource collection API of Datastores. */ + public Datastores datastores() { + if (this.datastores == null) { + this.datastores = new DatastoresImpl(clientObject.getDatastores(), this); + } + return datastores; + } + + /** @return Resource collection API of HcxEnterpriseSites. */ + public HcxEnterpriseSites hcxEnterpriseSites() { + if (this.hcxEnterpriseSites == null) { + this.hcxEnterpriseSites = new HcxEnterpriseSitesImpl(clientObject.getHcxEnterpriseSites(), this); + } + return hcxEnterpriseSites; + } + + /** @return Resource collection API of Authorizations. */ + public Authorizations authorizations() { + if (this.authorizations == null) { + this.authorizations = new AuthorizationsImpl(clientObject.getAuthorizations(), this); + } + return authorizations; + } + + /** @return Resource collection API of GlobalReachConnections. */ + public GlobalReachConnections globalReachConnections() { + if (this.globalReachConnections == null) { + this.globalReachConnections = + new GlobalReachConnectionsImpl(clientObject.getGlobalReachConnections(), this); + } + return globalReachConnections; + } + + /** @return Resource collection API of WorkloadNetworks. */ + public WorkloadNetworks workloadNetworks() { + if (this.workloadNetworks == null) { + this.workloadNetworks = new WorkloadNetworksImpl(clientObject.getWorkloadNetworks(), this); + } + return workloadNetworks; + } + + /** @return Resource collection API of Addons. */ + public Addons addons() { + if (this.addons == null) { + this.addons = new AddonsImpl(clientObject.getAddons(), this); + } + return addons; + } + + /** + * @return Wrapped service client AvsClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public AvsClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.java new file mode 100644 index 000000000000..f428bb60738e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AddonsClient.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.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; + +/** An instance of this class provides access to all the operations defined in AddonsClient. */ +public interface AddonsClient { + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner get(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner createOrUpdate(String resourceGroupName, String privateCloudName, String addonName, AddonInner addon); + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AddonInner createOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String addonName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java new file mode 100644 index 000000000000..a48b80843c44 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AuthorizationsClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; + +/** An instance of this class provides access to all the operations defined in AuthorizationsClient. */ +public interface AuthorizationsClient { + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteAuthorizationInner get(String resourceGroupName, String privateCloudName, String authorizationName); + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String authorizationName, Context context); + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteAuthorizationInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization); + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExpressRouteAuthorizationInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + Context context); + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteAuthorizationInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization); + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteAuthorizationInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + Context context); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String authorizationName); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String authorizationName, Context context); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String authorizationName); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String authorizationName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java new file mode 100644 index 000000000000..39846d204e6c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/AvsClient.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AvsClient class. */ +public interface AvsClient { + /** + * 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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the PrivateCloudsClient object to access its operations. + * + * @return the PrivateCloudsClient object. + */ + PrivateCloudsClient getPrivateClouds(); + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + DatastoresClient getDatastores(); + + /** + * Gets the HcxEnterpriseSitesClient object to access its operations. + * + * @return the HcxEnterpriseSitesClient object. + */ + HcxEnterpriseSitesClient getHcxEnterpriseSites(); + + /** + * Gets the AuthorizationsClient object to access its operations. + * + * @return the AuthorizationsClient object. + */ + AuthorizationsClient getAuthorizations(); + + /** + * Gets the GlobalReachConnectionsClient object to access its operations. + * + * @return the GlobalReachConnectionsClient object. + */ + GlobalReachConnectionsClient getGlobalReachConnections(); + + /** + * Gets the WorkloadNetworksClient object to access its operations. + * + * @return the WorkloadNetworksClient object. + */ + WorkloadNetworksClient getWorkloadNetworks(); + + /** + * Gets the AddonsClient object to access its operations. + * + * @return the AddonsClient object. + */ + AddonsClient getAddons(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java new file mode 100644 index 000000000000..dbc01b327a67 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/ClustersClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.ClusterInner; +import com.azure.resourcemanager.avs.models.ClusterUpdate; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public interface ClustersClient { + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner get(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster); + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context); + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster); + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner createOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context); + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate); + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + Context context); + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate); + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + Context context); + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName); + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String clusterName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java new file mode 100644 index 000000000000..c3c7b6617713 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/DatastoresClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; + +/** An instance of this class provides access to all the operations defined in DatastoresClient. */ +public interface DatastoresClient { + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner get(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatastoreInner> beginCreate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore); + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, DatastoreInner> beginCreate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context); + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner create( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore); + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DatastoreInner create( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java new file mode 100644 index 000000000000..8d356f7f0219 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/GlobalReachConnectionsClient.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; + +/** An instance of this class provides access to all the operations defined in GlobalReachConnectionsClient. */ +public interface GlobalReachConnectionsClient { + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalReachConnectionInner get(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection); + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.java new file mode 100644 index 000000000000..34f3d77449ed --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/HcxEnterpriseSitesClient.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.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; + +/** An instance of this class provides access to all the operations defined in HcxEnterpriseSitesClient. */ +public interface HcxEnterpriseSitesClient { + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcxEnterpriseSiteInner get(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName); + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context); + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HcxEnterpriseSiteInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite); + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite, + Context context); + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName); + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.java new file mode 100644 index 000000000000..94c7fab6eb3d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/LocationsClient.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.avs.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.avs.fluent.models.QuotaInner; +import com.azure.resourcemanager.avs.fluent.models.TrialInner; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TrialInner checkTrialAvailability(String location); + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkTrialAvailabilityWithResponse(String location, Context context); + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaInner checkQuotaAvailability(String location); + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkQuotaAvailabilityWithResponse(String location, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java new file mode 100644 index 000000000000..090e5625b134 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java new file mode 100644 index 000000000000..fda61e8fb858 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/PrivateCloudsClient.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; + +/** An instance of this class provides access to all the operations defined in PrivateCloudsClient. */ +public interface PrivateCloudsClient { + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List private clouds in a 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 paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List private clouds in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List private clouds in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateCloudInner getByResourceGroup(String resourceGroupName, String privateCloudName); + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateCloudInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud); + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateCloudInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context); + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateCloudInner createOrUpdate(String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud); + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateCloudInner createOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context); + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateCloudInner> beginUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate); + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateCloudInner> beginUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context); + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateCloudInner update(String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate); + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateCloudInner update( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context); + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName); + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName, Context context); + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName); + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateVcenterPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateVcenterPassword( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateVcenterPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateNsxtPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateNsxtPassword( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateNsxtPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName); + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAdminCredentialsWithResponse( + String resourceGroupName, String privateCloudName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java new file mode 100644 index 000000000000..db61fb811b67 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/WorkloadNetworksClient.java @@ -0,0 +1,1794 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; + +/** An instance of this class provides access to all the operations defined in WorkloadNetworksClient. */ +public interface WorkloadNetworksClient { + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSegments(String resourceGroupName, String privateCloudName); + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment); + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDhcp(String resourceGroupName, String privateCloudName); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDhcp( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, WorkloadNetworkDhcpInner workloadNetworkDhcp); + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGateways(String resourceGroupName, String privateCloudName); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring); + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVMGroups(String resourceGroupName, String privateCloudName); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup); + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkVirtualMachineInner getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsServices(String resourceGroupName, String privateCloudName); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner getDnsService( + String resourceGroupName, String privateCloudName, String dnsServiceId); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService); + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsZones(String resourceGroupName, String privateCloudName); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone); + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java new file mode 100644 index 000000000000..46714f787f8e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AddonInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.AddonProvisioningState; +import com.azure.resourcemanager.avs.models.AddonType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An addon resource. */ +@JsonFlatten +@Fluent +public class AddonInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonInner.class); + + /* + * The SRM license + */ + @JsonProperty(value = "properties.licenseKey") + private String licenseKey; + + /* + * The type of private cloud addon + */ + @JsonProperty(value = "properties.addonType") + private AddonType addonType; + + /* + * The state of the addon provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AddonProvisioningState provisioningState; + + /** + * Get the licenseKey property: The SRM license. + * + * @return the licenseKey value. + */ + public String licenseKey() { + return this.licenseKey; + } + + /** + * Set the licenseKey property: The SRM license. + * + * @param licenseKey the licenseKey value to set. + * @return the AddonInner object itself. + */ + public AddonInner withLicenseKey(String licenseKey) { + this.licenseKey = licenseKey; + return this; + } + + /** + * Get the addonType property: The type of private cloud addon. + * + * @return the addonType value. + */ + public AddonType addonType() { + return this.addonType; + } + + /** + * Set the addonType property: The type of private cloud addon. + * + * @param addonType the addonType value to set. + * @return the AddonInner object itself. + */ + public AddonInner withAddonType(AddonType addonType) { + this.addonType = addonType; + return this; + } + + /** + * Get the provisioningState property: The state of the addon provisioning. + * + * @return the provisioningState value. + */ + public AddonProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.java new file mode 100644 index 000000000000..376dc6d0bd13 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/AdminCredentialsInner.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.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Administrative credentials for accessing vCenter and NSX-T. */ +@Immutable +public final class AdminCredentialsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AdminCredentialsInner.class); + + /* + * NSX-T Manager username + */ + @JsonProperty(value = "nsxtUsername", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtUsername; + + /* + * NSX-T Manager password + */ + @JsonProperty(value = "nsxtPassword", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtPassword; + + /* + * vCenter admin username + */ + @JsonProperty(value = "vcenterUsername", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterUsername; + + /* + * vCenter admin password + */ + @JsonProperty(value = "vcenterPassword", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterPassword; + + /** + * Get the nsxtUsername property: NSX-T Manager username. + * + * @return the nsxtUsername value. + */ + public String nsxtUsername() { + return this.nsxtUsername; + } + + /** + * Get the nsxtPassword property: NSX-T Manager password. + * + * @return the nsxtPassword value. + */ + public String nsxtPassword() { + return this.nsxtPassword; + } + + /** + * Get the vcenterUsername property: vCenter admin username. + * + * @return the vcenterUsername value. + */ + public String vcenterUsername() { + return this.vcenterUsername; + } + + /** + * Get the vcenterPassword property: vCenter admin password. + * + * @return the vcenterPassword value. + */ + public String vcenterPassword() { + return this.vcenterPassword; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java new file mode 100644 index 000000000000..8266d0b1a0f0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ClusterInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.ClusterProvisioningState; +import com.azure.resourcemanager.avs.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A cluster resource. */ +@JsonFlatten +@Fluent +public class ClusterInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); + + /* + * The cluster SKU + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * The state of the cluster provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterProvisioningState provisioningState; + + /* + * The cluster size + */ + @JsonProperty(value = "properties.clusterSize") + private Integer clusterSize; + + /* + * The identity + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private Integer clusterId; + + /* + * The hosts + */ + @JsonProperty(value = "properties.hosts", access = JsonProperty.Access.WRITE_ONLY) + private List hosts; + + /** + * Get the sku property: The cluster SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The cluster SKU. + * + * @param sku the sku value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the provisioningState property: The state of the cluster provisioning. + * + * @return the provisioningState value. + */ + public ClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterSize property: The cluster size. + * + * @return the clusterSize value. + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the clusterSize property: The cluster size. + * + * @param clusterSize the clusterSize value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Get the clusterId property: The identity. + * + * @return the clusterId value. + */ + public Integer clusterId() { + return this.clusterId; + } + + /** + * Get the hosts property: The hosts. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model ClusterInner")); + } else { + sku().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java new file mode 100644 index 000000000000..7bb6368492e1 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/DatastoreInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; +import com.azure.resourcemanager.avs.models.DiskPoolVolume; +import com.azure.resourcemanager.avs.models.NetAppVolume; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A datastore resource. */ +@JsonFlatten +@Fluent +public class DatastoreInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatastoreInner.class); + + /* + * The state of the datastore provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DatastoreProvisioningState provisioningState; + + /* + * An Azure NetApp Files volume + */ + @JsonProperty(value = "properties.netAppVolume") + private NetAppVolume netAppVolume; + + /* + * An iSCSI volume + */ + @JsonProperty(value = "properties.diskPoolVolume") + private DiskPoolVolume diskPoolVolume; + + /** + * Get the provisioningState property: The state of the datastore provisioning. + * + * @return the provisioningState value. + */ + public DatastoreProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the netAppVolume property: An Azure NetApp Files volume. + * + * @return the netAppVolume value. + */ + public NetAppVolume netAppVolume() { + return this.netAppVolume; + } + + /** + * Set the netAppVolume property: An Azure NetApp Files volume. + * + * @param netAppVolume the netAppVolume value to set. + * @return the DatastoreInner object itself. + */ + public DatastoreInner withNetAppVolume(NetAppVolume netAppVolume) { + this.netAppVolume = netAppVolume; + return this; + } + + /** + * Get the diskPoolVolume property: An iSCSI volume. + * + * @return the diskPoolVolume value. + */ + public DiskPoolVolume diskPoolVolume() { + return this.diskPoolVolume; + } + + /** + * Set the diskPoolVolume property: An iSCSI volume. + * + * @param diskPoolVolume the diskPoolVolume value to set. + * @return the DatastoreInner object itself. + */ + public DatastoreInner withDiskPoolVolume(DiskPoolVolume diskPoolVolume) { + this.diskPoolVolume = diskPoolVolume; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (netAppVolume() != null) { + netAppVolume().validate(); + } + if (diskPoolVolume() != null) { + diskPoolVolume().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java new file mode 100644 index 000000000000..eb4136f698d2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/ExpressRouteAuthorizationInner.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ExpressRoute Circuit Authorization. */ +@JsonFlatten +@Immutable +public class ExpressRouteAuthorizationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteAuthorizationInner.class); + + /* + * The state of the ExpressRoute Circuit Authorization provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ExpressRouteAuthorizationProvisioningState provisioningState; + + /* + * The ID of the ExpressRoute Circuit Authorization + */ + @JsonProperty(value = "properties.expressRouteAuthorizationId", access = JsonProperty.Access.WRITE_ONLY) + private String expressRouteAuthorizationId; + + /* + * The key of the ExpressRoute Circuit Authorization + */ + @JsonProperty(value = "properties.expressRouteAuthorizationKey", access = JsonProperty.Access.WRITE_ONLY) + private String expressRouteAuthorizationKey; + + /** + * Get the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. + * + * @return the provisioningState value. + */ + public ExpressRouteAuthorizationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the expressRouteAuthorizationId property: The ID of the ExpressRoute Circuit Authorization. + * + * @return the expressRouteAuthorizationId value. + */ + public String expressRouteAuthorizationId() { + return this.expressRouteAuthorizationId; + } + + /** + * Get the expressRouteAuthorizationKey property: The key of the ExpressRoute Circuit Authorization. + * + * @return the expressRouteAuthorizationKey value. + */ + public String expressRouteAuthorizationKey() { + return this.expressRouteAuthorizationKey; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java new file mode 100644 index 000000000000..899656b7c46c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/GlobalReachConnectionInner.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A global reach connection resource. */ +@JsonFlatten +@Fluent +public class GlobalReachConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalReachConnectionInner.class); + + /* + * The state of the ExpressRoute Circuit Authorization provisioning + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GlobalReachConnectionProvisioningState provisioningState; + + /* + * The network used for global reach carved out from the original network + * block provided for the private cloud + */ + @JsonProperty(value = "properties.addressPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String addressPrefix; + + /* + * Authorization key from the peer express route used for the global reach + * connection + */ + @JsonProperty(value = "properties.authorizationKey") + private String authorizationKey; + + /* + * The connection status of the global reach connection + */ + @JsonProperty(value = "properties.circuitConnectionStatus", access = JsonProperty.Access.WRITE_ONLY) + private GlobalReachConnectionStatus circuitConnectionStatus; + + /* + * Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection + */ + @JsonProperty(value = "properties.peerExpressRouteCircuit") + private String peerExpressRouteCircuit; + + /** + * Get the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. + * + * @return the provisioningState value. + */ + public GlobalReachConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the addressPrefix property: The network used for global reach carved out from the original network block + * provided for the private cloud. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Get the authorizationKey property: Authorization key from the peer express route used for the global reach + * connection. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Set the authorizationKey property: Authorization key from the peer express route used for the global reach + * connection. + * + * @param authorizationKey the authorizationKey value to set. + * @return the GlobalReachConnectionInner object itself. + */ + public GlobalReachConnectionInner withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the circuitConnectionStatus property: The connection status of the global reach connection. + * + * @return the circuitConnectionStatus value. + */ + public GlobalReachConnectionStatus circuitConnectionStatus() { + return this.circuitConnectionStatus; + } + + /** + * Get the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * + * @return the peerExpressRouteCircuit value. + */ + public String peerExpressRouteCircuit() { + return this.peerExpressRouteCircuit; + } + + /** + * Set the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * + * @param peerExpressRouteCircuit the peerExpressRouteCircuit value to set. + * @return the GlobalReachConnectionInner object itself. + */ + public GlobalReachConnectionInner withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { + this.peerExpressRouteCircuit = peerExpressRouteCircuit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java new file mode 100644 index 000000000000..6e5948edc409 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/HcxEnterpriseSiteInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An HCX Enterprise Site resource. */ +@JsonFlatten +@Immutable +public class HcxEnterpriseSiteInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HcxEnterpriseSiteInner.class); + + /* + * The activation key + */ + @JsonProperty(value = "properties.activationKey", access = JsonProperty.Access.WRITE_ONLY) + private String activationKey; + + /* + * The status of the HCX Enterprise Site + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private HcxEnterpriseSiteStatus status; + + /** + * Get the activationKey property: The activation key. + * + * @return the activationKey value. + */ + public String activationKey() { + return this.activationKey; + } + + /** + * Get the status property: The status of the HCX Enterprise Site. + * + * @return the status value. + */ + public HcxEnterpriseSiteStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.java new file mode 100644 index 000000000000..0967f90c2264 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/OperationInner.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.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.OperationDisplay; +import com.azure.resourcemanager.avs.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Name of the operation being performed on this object + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Contains the localized display information for this operation + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private OperationDisplay display; + + /* + * Gets or sets a value indicating whether the operation is a data action + * or not + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get the name property: Name of the operation being performed on this object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the display property: Contains the localized display information for this operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java new file mode 100644 index 000000000000..d62730f732e5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/PrivateCloudInner.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.Circuit; +import com.azure.resourcemanager.avs.models.Endpoints; +import com.azure.resourcemanager.avs.models.IdentitySource; +import com.azure.resourcemanager.avs.models.InternetEnum; +import com.azure.resourcemanager.avs.models.ManagementCluster; +import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState; +import com.azure.resourcemanager.avs.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A private cloud resource. */ +@JsonFlatten +@Fluent +public class PrivateCloudInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudInner.class); + + /* + * The private cloud SKU + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * The default cluster used for management + */ + @JsonProperty(value = "properties.managementCluster") + private ManagementCluster managementCluster; + + /* + * Connectivity to internet is enabled or disabled + */ + @JsonProperty(value = "properties.internet") + private InternetEnum internet; + + /* + * vCenter Single Sign On Identity Sources + */ + @JsonProperty(value = "properties.identitySources") + private List identitySources; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateCloudProvisioningState provisioningState; + + /* + * An ExpressRoute Circuit + */ + @JsonProperty(value = "properties.circuit") + private Circuit circuit; + + /* + * The endpoints + */ + @JsonProperty(value = "properties.endpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints endpoints; + + /* + * The block of addresses should be unique across VNet in your subscription + * as well as on-premise. Make sure the CIDR format is conformed to + * (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and + * 22 + */ + @JsonProperty(value = "properties.networkBlock") + private String networkBlock; + + /* + * Network used to access vCenter Server and NSX-T Manager + */ + @JsonProperty(value = "properties.managementNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String managementNetwork; + + /* + * Used for virtual machine cold migration, cloning, and snapshot migration + */ + @JsonProperty(value = "properties.provisioningNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningNetwork; + + /* + * Used for live migration of virtual machines + */ + @JsonProperty(value = "properties.vmotionNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String vmotionNetwork; + + /* + * Optionally, set the vCenter admin password when the private cloud is + * created + */ + @JsonProperty(value = "properties.vcenterPassword") + private String vcenterPassword; + + /* + * Optionally, set the NSX-T Manager password when the private cloud is + * created + */ + @JsonProperty(value = "properties.nsxtPassword") + private String nsxtPassword; + + /* + * Thumbprint of the vCenter Server SSL certificate + */ + @JsonProperty(value = "properties.vcenterCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterCertificateThumbprint; + + /* + * Thumbprint of the NSX-T Manager SSL certificate + */ + @JsonProperty(value = "properties.nsxtCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtCertificateThumbprint; + + /** + * Get the sku property: The private cloud SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The private cloud SKU. + * + * @param sku the sku value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the managementCluster property: The default cluster used for management. + * + * @return the managementCluster value. + */ + public ManagementCluster managementCluster() { + return this.managementCluster; + } + + /** + * Set the managementCluster property: The default cluster used for management. + * + * @param managementCluster the managementCluster value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withManagementCluster(ManagementCluster managementCluster) { + this.managementCluster = managementCluster; + return this; + } + + /** + * Get the internet property: Connectivity to internet is enabled or disabled. + * + * @return the internet value. + */ + public InternetEnum internet() { + return this.internet; + } + + /** + * Set the internet property: Connectivity to internet is enabled or disabled. + * + * @param internet the internet value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withInternet(InternetEnum internet) { + this.internet = internet; + return this; + } + + /** + * Get the identitySources property: vCenter Single Sign On Identity Sources. + * + * @return the identitySources value. + */ + public List identitySources() { + return this.identitySources; + } + + /** + * Set the identitySources property: vCenter Single Sign On Identity Sources. + * + * @param identitySources the identitySources value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withIdentitySources(List identitySources) { + this.identitySources = identitySources; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public PrivateCloudProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the circuit property: An ExpressRoute Circuit. + * + * @return the circuit value. + */ + public Circuit circuit() { + return this.circuit; + } + + /** + * Set the circuit property: An ExpressRoute Circuit. + * + * @param circuit the circuit value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withCircuit(Circuit circuit) { + this.circuit = circuit; + return this; + } + + /** + * Get the endpoints property: The endpoints. + * + * @return the endpoints value. + */ + public Endpoints endpoints() { + return this.endpoints; + } + + /** + * Get the networkBlock property: The block of addresses should be unique across VNet in your subscription as well + * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X + * is between 0 and 22. + * + * @return the networkBlock value. + */ + public String networkBlock() { + return this.networkBlock; + } + + /** + * Set the networkBlock property: The block of addresses should be unique across VNet in your subscription as well + * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X + * is between 0 and 22. + * + * @param networkBlock the networkBlock value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withNetworkBlock(String networkBlock) { + this.networkBlock = networkBlock; + return this; + } + + /** + * Get the managementNetwork property: Network used to access vCenter Server and NSX-T Manager. + * + * @return the managementNetwork value. + */ + public String managementNetwork() { + return this.managementNetwork; + } + + /** + * Get the provisioningNetwork property: Used for virtual machine cold migration, cloning, and snapshot migration. + * + * @return the provisioningNetwork value. + */ + public String provisioningNetwork() { + return this.provisioningNetwork; + } + + /** + * Get the vmotionNetwork property: Used for live migration of virtual machines. + * + * @return the vmotionNetwork value. + */ + public String vmotionNetwork() { + return this.vmotionNetwork; + } + + /** + * Get the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. + * + * @return the vcenterPassword value. + */ + public String vcenterPassword() { + return this.vcenterPassword; + } + + /** + * Set the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. + * + * @param vcenterPassword the vcenterPassword value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withVcenterPassword(String vcenterPassword) { + this.vcenterPassword = vcenterPassword; + return this; + } + + /** + * Get the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. + * + * @return the nsxtPassword value. + */ + public String nsxtPassword() { + return this.nsxtPassword; + } + + /** + * Set the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. + * + * @param nsxtPassword the nsxtPassword value to set. + * @return the PrivateCloudInner object itself. + */ + public PrivateCloudInner withNsxtPassword(String nsxtPassword) { + this.nsxtPassword = nsxtPassword; + return this; + } + + /** + * Get the vcenterCertificateThumbprint property: Thumbprint of the vCenter Server SSL certificate. + * + * @return the vcenterCertificateThumbprint value. + */ + public String vcenterCertificateThumbprint() { + return this.vcenterCertificateThumbprint; + } + + /** + * Get the nsxtCertificateThumbprint property: Thumbprint of the NSX-T Manager SSL certificate. + * + * @return the nsxtCertificateThumbprint value. + */ + public String nsxtCertificateThumbprint() { + return this.nsxtCertificateThumbprint; + } + + /** {@inheritDoc} */ + @Override + public PrivateCloudInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateCloudInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model PrivateCloudInner")); + } else { + sku().validate(); + } + if (managementCluster() != null) { + managementCluster().validate(); + } + if (identitySources() != null) { + identitySources().forEach(e -> e.validate()); + } + if (circuit() != null) { + circuit().validate(); + } + if (endpoints() != null) { + endpoints().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.java new file mode 100644 index 000000000000..51892f2df386 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/QuotaInner.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.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.QuotaEnabled; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Subscription quotas. */ +@Immutable +public final class QuotaInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaInner.class); + + /* + * Remaining hosts quota by sku type + */ + @JsonProperty(value = "hostsRemaining", access = JsonProperty.Access.WRITE_ONLY) + private Map hostsRemaining; + + /* + * Host quota is active for current subscription + */ + @JsonProperty(value = "quotaEnabled", access = JsonProperty.Access.WRITE_ONLY) + private QuotaEnabled quotaEnabled; + + /** + * Get the hostsRemaining property: Remaining hosts quota by sku type. + * + * @return the hostsRemaining value. + */ + public Map hostsRemaining() { + return this.hostsRemaining; + } + + /** + * Get the quotaEnabled property: Host quota is active for current subscription. + * + * @return the quotaEnabled value. + */ + public QuotaEnabled quotaEnabled() { + return this.quotaEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.java new file mode 100644 index 000000000000..94a14b99465b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/TrialInner.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.avs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.TrialStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Subscription trial availability. */ +@Immutable +public final class TrialInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrialInner.class); + + /* + * Trial status + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private TrialStatus status; + + /* + * Number of trial hosts available + */ + @JsonProperty(value = "availableHosts", access = JsonProperty.Access.WRITE_ONLY) + private Integer availableHosts; + + /** + * Get the status property: Trial status. + * + * @return the status value. + */ + public TrialStatus status() { + return this.status; + } + + /** + * Get the availableHosts property: Number of trial hosts available. + * + * @return the availableHosts value. + */ + public Integer availableHosts() { + return this.availableHosts; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java new file mode 100644 index 000000000000..30703262da75 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDhcpInner.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX DHCP. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkDhcpInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpInner.class); + + /* + * Display name of the DHCP entity. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * NSX Segments consuming DHCP. + */ + @JsonProperty(value = "properties.segments", access = JsonProperty.Access.WRITE_ONLY) + private List segments; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDhcpProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DHCP entity. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDhcpInner object itself. + */ + public WorkloadNetworkDhcpInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the segments property: NSX Segments consuming DHCP. + * + * @return the segments value. + */ + public List segments() { + return this.segments; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDhcpInner object itself. + */ + public WorkloadNetworkDhcpInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java new file mode 100644 index 000000000000..237872d1bd2f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsServiceInner.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX DNS Service. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkDnsServiceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsServiceInner.class); + + /* + * Display name of the DNS Service. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * DNS service IP of the DNS Service. + */ + @JsonProperty(value = "properties.dnsServiceIp") + private String dnsServiceIp; + + /* + * Default DNS zone of the DNS Service. + */ + @JsonProperty(value = "properties.defaultDnsZone") + private String defaultDnsZone; + + /* + * FQDN zones of the DNS Service. + */ + @JsonProperty(value = "properties.fqdnZones") + private List fqdnZones; + + /* + * DNS Service log level. + */ + @JsonProperty(value = "properties.logLevel") + private DnsServiceLogLevelEnum logLevel; + + /* + * DNS Service status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private DnsServiceStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDnsServiceProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DNS Service. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DNS Service. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the dnsServiceIp property: DNS service IP of the DNS Service. + * + * @return the dnsServiceIp value. + */ + public String dnsServiceIp() { + return this.dnsServiceIp; + } + + /** + * Set the dnsServiceIp property: DNS service IP of the DNS Service. + * + * @param dnsServiceIp the dnsServiceIp value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withDnsServiceIp(String dnsServiceIp) { + this.dnsServiceIp = dnsServiceIp; + return this; + } + + /** + * Get the defaultDnsZone property: Default DNS zone of the DNS Service. + * + * @return the defaultDnsZone value. + */ + public String defaultDnsZone() { + return this.defaultDnsZone; + } + + /** + * Set the defaultDnsZone property: Default DNS zone of the DNS Service. + * + * @param defaultDnsZone the defaultDnsZone value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withDefaultDnsZone(String defaultDnsZone) { + this.defaultDnsZone = defaultDnsZone; + return this; + } + + /** + * Get the fqdnZones property: FQDN zones of the DNS Service. + * + * @return the fqdnZones value. + */ + public List fqdnZones() { + return this.fqdnZones; + } + + /** + * Set the fqdnZones property: FQDN zones of the DNS Service. + * + * @param fqdnZones the fqdnZones value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withFqdnZones(List fqdnZones) { + this.fqdnZones = fqdnZones; + return this; + } + + /** + * Get the logLevel property: DNS Service log level. + * + * @return the logLevel value. + */ + public DnsServiceLogLevelEnum logLevel() { + return this.logLevel; + } + + /** + * Set the logLevel property: DNS Service log level. + * + * @param logLevel the logLevel value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withLogLevel(DnsServiceLogLevelEnum logLevel) { + this.logLevel = logLevel; + return this; + } + + /** + * Get the status property: DNS Service status. + * + * @return the status value. + */ + public DnsServiceStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDnsServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDnsServiceInner object itself. + */ + public WorkloadNetworkDnsServiceInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.java new file mode 100644 index 000000000000..ab9f9c002bda --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkDnsZoneInner.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.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX DNS Zone. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkDnsZoneInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsZoneInner.class); + + /* + * Display name of the DNS Zone. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Domain names of the DNS Zone. + */ + @JsonProperty(value = "properties.domain") + private List domain; + + /* + * DNS Server IP array of the DNS Zone. + */ + @JsonProperty(value = "properties.dnsServerIps") + private List dnsServerIps; + + /* + * Source IP of the DNS Zone. + */ + @JsonProperty(value = "properties.sourceIp") + private String sourceIp; + + /* + * Number of DNS Services using the DNS zone. + */ + @JsonProperty(value = "properties.dnsServices") + private Long dnsServices; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDnsZoneProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DNS Zone. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DNS Zone. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the domain property: Domain names of the DNS Zone. + * + * @return the domain value. + */ + public List domain() { + return this.domain; + } + + /** + * Set the domain property: Domain names of the DNS Zone. + * + * @param domain the domain value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDomain(List domain) { + this.domain = domain; + return this; + } + + /** + * Get the dnsServerIps property: DNS Server IP array of the DNS Zone. + * + * @return the dnsServerIps value. + */ + public List dnsServerIps() { + return this.dnsServerIps; + } + + /** + * Set the dnsServerIps property: DNS Server IP array of the DNS Zone. + * + * @param dnsServerIps the dnsServerIps value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDnsServerIps(List dnsServerIps) { + this.dnsServerIps = dnsServerIps; + return this; + } + + /** + * Get the sourceIp property: Source IP of the DNS Zone. + * + * @return the sourceIp value. + */ + public String sourceIp() { + return this.sourceIp; + } + + /** + * Set the sourceIp property: Source IP of the DNS Zone. + * + * @param sourceIp the sourceIp value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withSourceIp(String sourceIp) { + this.sourceIp = sourceIp; + return this; + } + + /** + * Get the dnsServices property: Number of DNS Services using the DNS zone. + * + * @return the dnsServices value. + */ + public Long dnsServices() { + return this.dnsServices; + } + + /** + * Set the dnsServices property: Number of DNS Services using the DNS zone. + * + * @param dnsServices the dnsServices value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withDnsServices(Long dnsServices) { + this.dnsServices = dnsServices; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDnsZoneProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDnsZoneInner object itself. + */ + public WorkloadNetworkDnsZoneInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.java new file mode 100644 index 000000000000..941d791f1645 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkGatewayInner.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.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Gateway. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkGatewayInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkGatewayInner.class); + + /* + * Display name of the DHCP entity. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * NSX Gateway Path. + */ + @JsonProperty(value = "properties.path", access = JsonProperty.Access.WRITE_ONLY) + private String path; + + /** + * Get the displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DHCP entity. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkGatewayInner object itself. + */ + public WorkloadNetworkGatewayInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the path property: NSX Gateway Path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java new file mode 100644 index 000000000000..a28735c0b825 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkPortMirroringInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Port Mirroring. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkPortMirroringInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkPortMirroringInner.class); + + /* + * Display name of the port mirroring profile. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Direction of port mirroring profile. + */ + @JsonProperty(value = "properties.direction") + private PortMirroringDirectionEnum direction; + + /* + * Source VM Group. + */ + @JsonProperty(value = "properties.source") + private String source; + + /* + * Destination VM Group. + */ + @JsonProperty(value = "properties.destination") + private String destination; + + /* + * Port Mirroring Status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private PortMirroringStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkPortMirroringProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the port mirroring profile. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the port mirroring profile. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the direction property: Direction of port mirroring profile. + * + * @return the direction value. + */ + public PortMirroringDirectionEnum direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of port mirroring profile. + * + * @param direction the direction value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDirection(PortMirroringDirectionEnum direction) { + this.direction = direction; + return this; + } + + /** + * Get the source property: Source VM Group. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source VM Group. + * + * @param source the source value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination VM Group. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Destination VM Group. + * + * @param destination the destination value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the status property: Port Mirroring Status. + * + * @return the status value. + */ + public PortMirroringStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkPortMirroringProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkPortMirroringInner object itself. + */ + public WorkloadNetworkPortMirroringInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.java new file mode 100644 index 000000000000..7c2bf99df503 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkSegmentInner.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.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.SegmentStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX Segment. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkSegmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentInner.class); + + /* + * Display name of the segment. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Gateway which to connect segment to. + */ + @JsonProperty(value = "properties.connectedGateway") + private String connectedGateway; + + /* + * Subnet which to connect segment to. + */ + @JsonProperty(value = "properties.subnet") + private WorkloadNetworkSegmentSubnet subnet; + + /* + * Port Vif which segment is associated with. + */ + @JsonProperty(value = "properties.portVif", access = JsonProperty.Access.WRITE_ONLY) + private List portVif; + + /* + * Segment status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private SegmentStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkSegmentProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the segment. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the segment. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the connectedGateway property: Gateway which to connect segment to. + * + * @return the connectedGateway value. + */ + public String connectedGateway() { + return this.connectedGateway; + } + + /** + * Set the connectedGateway property: Gateway which to connect segment to. + * + * @param connectedGateway the connectedGateway value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withConnectedGateway(String connectedGateway) { + this.connectedGateway = connectedGateway; + return this; + } + + /** + * Get the subnet property: Subnet which to connect segment to. + * + * @return the subnet value. + */ + public WorkloadNetworkSegmentSubnet subnet() { + return this.subnet; + } + + /** + * Set the subnet property: Subnet which to connect segment to. + * + * @param subnet the subnet value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withSubnet(WorkloadNetworkSegmentSubnet subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the portVif property: Port Vif which segment is associated with. + * + * @return the portVif value. + */ + public List portVif() { + return this.portVif; + } + + /** + * Get the status property: Segment status. + * + * @return the status value. + */ + public SegmentStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkSegmentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkSegmentInner object itself. + */ + public WorkloadNetworkSegmentInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + if (portVif() != null) { + portVif().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java new file mode 100644 index 000000000000..510d3a0e19f2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVMGroupInner.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** NSX VM Group. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkVMGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVMGroupInner.class); + + /* + * Display name of the VM group. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Virtual machine members of this group. + */ + @JsonProperty(value = "properties.members") + private List members; + + /* + * VM Group status. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private VMGroupStatusEnum status; + + /* + * The provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkVMGroupProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "properties.revision") + private Long revision; + + /** + * Get the displayName property: Display name of the VM group. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the VM group. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the members property: Virtual machine members of this group. + * + * @return the members value. + */ + public List members() { + return this.members; + } + + /** + * Set the members property: Virtual machine members of this group. + * + * @param members the members value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withMembers(List members) { + this.members = members; + return this; + } + + /** + * Get the status property: VM Group status. + * + * @return the status value. + */ + public VMGroupStatusEnum status() { + return this.status; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkVMGroupProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkVMGroupInner object itself. + */ + public WorkloadNetworkVMGroupInner withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java new file mode 100644 index 000000000000..680961140548 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/WorkloadNetworkVirtualMachineInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.models.VMTypeEnum; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** NSX Virtual Machine. */ +@JsonFlatten +@Fluent +public class WorkloadNetworkVirtualMachineInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVirtualMachineInner.class); + + /* + * Display name of the VM. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /* + * Virtual machine type. + */ + @JsonProperty(value = "properties.vmType", access = JsonProperty.Access.WRITE_ONLY) + private VMTypeEnum vmType; + + /** + * Get the displayName property: Display name of the VM. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the VM. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkVirtualMachineInner object itself. + */ + public WorkloadNetworkVirtualMachineInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the vmType property: Virtual machine type. + * + * @return the vmType value. + */ + public VMTypeEnum vmType() { + return this.vmType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/models/package-info.java new file mode 100644 index 000000000000..21b999ee064b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/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 AvsClient. Azure VMware Solution API. */ +package com.azure.resourcemanager.avs.fluent.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/fluent/package-info.java new file mode 100644 index 000000000000..7be76d283ea0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/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 AvsClient. Azure VMware Solution API. */ +package com.azure.resourcemanager.avs.fluent; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java new file mode 100644 index 000000000000..a1be5d57f3df --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.azure.resourcemanager.avs.models.Addon; +import com.azure.resourcemanager.avs.models.AddonProvisioningState; +import com.azure.resourcemanager.avs.models.AddonType; + +public final class AddonImpl implements Addon, Addon.Definition, Addon.Update { + private AddonInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String licenseKey() { + return this.innerModel().licenseKey(); + } + + public AddonType addonType() { + return this.innerModel().addonType(); + } + + public AddonProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public AddonInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String addonName; + + public AddonImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public Addon create() { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), Context.NONE); + return this; + } + + public Addon create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), context); + return this; + } + + AddonImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new AddonInner(); + this.serviceManager = serviceManager; + this.addonName = name; + } + + public AddonImpl update() { + return this; + } + + public Addon apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), Context.NONE); + return this; + } + + public Addon apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .createOrUpdate(resourceGroupName, privateCloudName, addonName, this.innerModel(), context); + return this; + } + + AddonImpl(AddonInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.addonName = Utils.getValueFromIdByName(innerObject.id(), "addons"); + } + + public Addon refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .getWithResponse(resourceGroupName, privateCloudName, addonName, Context.NONE) + .getValue(); + return this; + } + + public Addon refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAddons() + .getWithResponse(resourceGroupName, privateCloudName, addonName, context) + .getValue(); + return this; + } + + public AddonImpl withLicenseKey(String licenseKey) { + this.innerModel().withLicenseKey(licenseKey); + return this; + } + + public AddonImpl withAddonType(AddonType addonType) { + this.innerModel().withAddonType(addonType); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java new file mode 100644 index 000000000000..847990c45d0f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsClientImpl.java @@ -0,0 +1,1093 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.AddonsClient; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.azure.resourcemanager.avs.models.AddonList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AddonsClient. */ +public final class AddonsClientImpl implements AddonsClient { + private final ClientLogger logger = new ClientLogger(AddonsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AddonsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of AddonsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AddonsClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(AddonsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientAddons to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientAddons") + private interface AddonsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("addonName") String addonName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("addonName") String addonName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AddonInner addon, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/addons/{addonName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("addonName") String addonName, + @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); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, String addonName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, addonName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner get(String resourceGroupName, String privateCloudName, String addonName) { + return getAsync(resourceGroupName, privateCloudName, addonName).block(); + } + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, addonName, context).block(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + return Mono.error(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + addon, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + if (addon == null) { + return Mono.error(new IllegalArgumentException("Parameter addon is required and cannot be null.")); + } else { + addon.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + addon, + accept, + context); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AddonInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AddonInner.class, AddonInner.class, Context.NONE); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AddonInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, addonName, addon, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AddonInner.class, AddonInner.class, context); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon).getSyncPoller(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AddonInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context).getSyncPoller(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner createOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon).block(); + } + + /** + * Create or update a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param addon A addon in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AddonInner createOrUpdate( + String resourceGroupName, String privateCloudName, String addonName, AddonInner addon, Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, addonName, addon, context).block(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String addonName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (addonName == null) { + return Mono.error(new IllegalArgumentException("Parameter addonName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + addonName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String addonName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, addonName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String addonName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName).getSyncPoller(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName, context).getSyncPoller(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String addonName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, addonName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String addonName) { + deleteAsync(resourceGroupName, privateCloudName, addonName).block(); + } + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String addonName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, addonName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of addons. + */ + @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 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 paged list of addons. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.java new file mode 100644 index 000000000000..abdae483097d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AddonsImpl.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.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.AddonsClient; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.azure.resourcemanager.avs.models.Addon; +import com.azure.resourcemanager.avs.models.Addons; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AddonsImpl implements Addons { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonsImpl.class); + + private final AddonsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public AddonsImpl(AddonsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new AddonImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new AddonImpl(inner1, this.manager())); + } + + public Addon get(String resourceGroupName, String privateCloudName, String addonName) { + AddonInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, addonName); + if (inner != null) { + return new AddonImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, addonName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AddonImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String addonName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, addonName); + } + + public void delete(String resourceGroupName, String privateCloudName, String addonName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, addonName, context); + } + + public Addon 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, addonName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, addonName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + this.delete(resourceGroupName, privateCloudName, addonName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String addonName = Utils.getValueFromIdByName(id, "addons"); + if (addonName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'addons'.", id))); + } + this.delete(resourceGroupName, privateCloudName, addonName, context); + } + + private AddonsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public AddonImpl define(String name) { + return new AddonImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java new file mode 100644 index 000000000000..72430f2f6c48 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AdminCredentialsImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; +import com.azure.resourcemanager.avs.models.AdminCredentials; + +public final class AdminCredentialsImpl implements AdminCredentials { + private AdminCredentialsInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + AdminCredentialsImpl(AdminCredentialsInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nsxtUsername() { + return this.innerModel().nsxtUsername(); + } + + public String nsxtPassword() { + return this.innerModel().nsxtPassword(); + } + + public String vcenterUsername() { + return this.innerModel().vcenterUsername(); + } + + public String vcenterPassword() { + return this.innerModel().vcenterPassword(); + } + + public AdminCredentialsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java new file mode 100644 index 000000000000..e7a29ade5805 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsClientImpl.java @@ -0,0 +1,1156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.AuthorizationsClient; +import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationList; +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 AuthorizationsClient. */ +public final class AuthorizationsClientImpl implements AuthorizationsClient { + private final ClientLogger logger = new ClientLogger(AuthorizationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AuthorizationsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of AuthorizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AuthorizationsClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(AuthorizationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientAuthorizations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientAuthorizati") + private interface AuthorizationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/authorizations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/authorizations/{authorizationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/authorizations/{authorizationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("authorizationName") String authorizationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExpressRouteAuthorizationInner authorization, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/authorizations/{authorizationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("authorizationName") String authorizationName, + @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); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + authorizationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String authorizationName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + authorizationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String authorizationName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, authorizationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteAuthorizationInner get( + String resourceGroupName, String privateCloudName, String authorizationName) { + return getAsync(resourceGroupName, privateCloudName, authorizationName).block(); + } + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, context).block(); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (authorization == null) { + return Mono.error(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + } else { + authorization.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + authorizationName, + this.client.getApiVersion(), + authorization, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + if (authorization == null) { + return Mono.error(new IllegalArgumentException("Parameter authorization is required and cannot be null.")); + } else { + authorization.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + authorizationName, + this.client.getApiVersion(), + authorization, + accept, + context); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteAuthorizationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, authorization); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteAuthorizationInner.class, + ExpressRouteAuthorizationInner.class, + Context.NONE); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExpressRouteAuthorizationInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, authorizationName, authorization, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExpressRouteAuthorizationInner.class, + ExpressRouteAuthorizationInner.class, + context); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteAuthorizationInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization) + .getSyncPoller(); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExpressRouteAuthorizationInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization, context) + .getSyncPoller(); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteAuthorizationInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization).block(); + } + + /** + * Create or update an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param authorization An ExpressRoute Circuit Authorization. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Circuit Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteAuthorizationInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String authorizationName, + ExpressRouteAuthorizationInner authorization, + Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, authorizationName, authorization, context) + .block(); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String authorizationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + authorizationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String authorizationName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (authorizationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter authorizationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + authorizationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String authorizationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, authorizationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, authorizationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String authorizationName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName).getSyncPoller(); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName, context).getSyncPoller(); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String authorizationName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, authorizationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String authorizationName) { + deleteAsync(resourceGroupName, privateCloudName, authorizationName).block(); + } + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, authorizationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of ExpressRoute Circuit Authorizations. + */ + @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 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 paged list of ExpressRoute Circuit Authorizations. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.java new file mode 100644 index 000000000000..7dc3f9a4df18 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AuthorizationsImpl.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.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.AuthorizationsClient; +import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; +import com.azure.resourcemanager.avs.models.Authorizations; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorization; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AuthorizationsImpl implements Authorizations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthorizationsImpl.class); + + private final AuthorizationsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public AuthorizationsImpl( + AuthorizationsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new ExpressRouteAuthorizationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new ExpressRouteAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRouteAuthorization get(String resourceGroupName, String privateCloudName, String authorizationName) { + ExpressRouteAuthorizationInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, authorizationName); + if (inner != null) { + return new ExpressRouteAuthorizationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, authorizationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExpressRouteAuthorizationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String authorizationName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, authorizationName); + } + + public void delete(String resourceGroupName, String privateCloudName, String authorizationName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, authorizationName, context); + } + + public ExpressRouteAuthorization 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, authorizationName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, authorizationName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, privateCloudName, authorizationName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String authorizationName = Utils.getValueFromIdByName(id, "authorizations"); + if (authorizationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'authorizations'.", id))); + } + this.delete(resourceGroupName, privateCloudName, authorizationName, context); + } + + private AuthorizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public ExpressRouteAuthorizationImpl define(String name) { + return new ExpressRouteAuthorizationImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java new file mode 100644 index 000000000000..e2270131fdb9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientBuilder.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.CookiePolicy; +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 AvsClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AvsClientImpl.class}) +public final class AvsClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the AvsClientBuilder. + */ + public AvsClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AvsClientBuilder. + */ + public AvsClientBuilder 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 AvsClientBuilder. + */ + public AvsClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 AvsClientBuilder. + */ + public AvsClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 AvsClientBuilder. + */ + public AvsClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 AvsClientBuilder. + */ + public AvsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AvsClientImpl with the provided parameters. + * + * @return an instance of AvsClientImpl. + */ + public AvsClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + AvsClientImpl client = + new AvsClientImpl(pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java new file mode 100644 index 000000000000..b6879308535b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/AvsClientImpl.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.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.avs.fluent.AddonsClient; +import com.azure.resourcemanager.avs.fluent.AuthorizationsClient; +import com.azure.resourcemanager.avs.fluent.AvsClient; +import com.azure.resourcemanager.avs.fluent.ClustersClient; +import com.azure.resourcemanager.avs.fluent.DatastoresClient; +import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; +import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; +import com.azure.resourcemanager.avs.fluent.LocationsClient; +import com.azure.resourcemanager.avs.fluent.OperationsClient; +import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; +import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; +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 java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the AvsClientImpl type. */ +@ServiceClient(builder = AvsClientBuilder.class) +public final class AvsClientImpl implements AvsClient { + private final ClientLogger logger = new ClientLogger(AvsClientImpl.class); + + /** 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 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; + } + + /** The LocationsClient object to access its operations. */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** The PrivateCloudsClient object to access its operations. */ + private final PrivateCloudsClient privateClouds; + + /** + * Gets the PrivateCloudsClient object to access its operations. + * + * @return the PrivateCloudsClient object. + */ + public PrivateCloudsClient getPrivateClouds() { + return this.privateClouds; + } + + /** The ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** The DatastoresClient object to access its operations. */ + private final DatastoresClient datastores; + + /** + * Gets the DatastoresClient object to access its operations. + * + * @return the DatastoresClient object. + */ + public DatastoresClient getDatastores() { + return this.datastores; + } + + /** The HcxEnterpriseSitesClient object to access its operations. */ + private final HcxEnterpriseSitesClient hcxEnterpriseSites; + + /** + * Gets the HcxEnterpriseSitesClient object to access its operations. + * + * @return the HcxEnterpriseSitesClient object. + */ + public HcxEnterpriseSitesClient getHcxEnterpriseSites() { + return this.hcxEnterpriseSites; + } + + /** The AuthorizationsClient object to access its operations. */ + private final AuthorizationsClient authorizations; + + /** + * Gets the AuthorizationsClient object to access its operations. + * + * @return the AuthorizationsClient object. + */ + public AuthorizationsClient getAuthorizations() { + return this.authorizations; + } + + /** The GlobalReachConnectionsClient object to access its operations. */ + private final GlobalReachConnectionsClient globalReachConnections; + + /** + * Gets the GlobalReachConnectionsClient object to access its operations. + * + * @return the GlobalReachConnectionsClient object. + */ + public GlobalReachConnectionsClient getGlobalReachConnections() { + return this.globalReachConnections; + } + + /** The WorkloadNetworksClient object to access its operations. */ + private final WorkloadNetworksClient workloadNetworks; + + /** + * Gets the WorkloadNetworksClient object to access its operations. + * + * @return the WorkloadNetworksClient object. + */ + public WorkloadNetworksClient getWorkloadNetworks() { + return this.workloadNetworks; + } + + /** The AddonsClient object to access its operations. */ + private final AddonsClient addons; + + /** + * Gets the AddonsClient object to access its operations. + * + * @return the AddonsClient object. + */ + public AddonsClient getAddons() { + return this.addons; + } + + /** + * Initializes an instance of AvsClient 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. + */ + AvsClientImpl( + 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 = "2021-01-01-preview"; + this.operations = new OperationsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.privateClouds = new PrivateCloudsClientImpl(this); + this.clusters = new ClustersClientImpl(this); + this.datastores = new DatastoresClientImpl(this); + this.hcxEnterpriseSites = new HcxEnterpriseSitesClientImpl(this); + this.authorizations = new AuthorizationsClientImpl(this); + this.globalReachConnections = new GlobalReachConnectionsClientImpl(this); + this.workloadNetworks = new WorkloadNetworksClientImpl(this); + this.addons = new AddonsClientImpl(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) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return 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)); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java new file mode 100644 index 000000000000..8e61064b9606 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClusterImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ClusterInner; +import com.azure.resourcemanager.avs.models.Cluster; +import com.azure.resourcemanager.avs.models.ClusterProvisioningState; +import com.azure.resourcemanager.avs.models.ClusterUpdate; +import com.azure.resourcemanager.avs.models.Sku; +import java.util.Collections; +import java.util.List; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public ClusterProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer clusterSize() { + return this.innerModel().clusterSize(); + } + + public Integer clusterId() { + return this.innerModel().clusterId(); + } + + public List hosts() { + List inner = this.innerModel().hosts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String clusterName; + + private ClusterUpdate updateClusterUpdate; + + public ClusterImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, privateCloudName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .createOrUpdate(resourceGroupName, privateCloudName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + this.updateClusterUpdate = new ClusterUpdate(); + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, privateCloudName, clusterName, updateClusterUpdate, Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, privateCloudName, clusterName, updateClusterUpdate, context); + return this; + } + + ClusterImpl(ClusterInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, context) + .getValue(); + return this; + } + + public ClusterImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ClusterImpl withClusterSize(Integer clusterSize) { + if (isInCreateMode()) { + this.innerModel().withClusterSize(clusterSize); + return this; + } else { + this.updateClusterUpdate.withClusterSize(clusterSize); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java new file mode 100644 index 000000000000..b92a894c0ba2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersClientImpl.java @@ -0,0 +1,1418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.ClustersClient; +import com.azure.resourcemanager.avs.fluent.models.ClusterInner; +import com.azure.resourcemanager.avs.models.ClusterList; +import com.azure.resourcemanager.avs.models.ClusterUpdate; +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 ClustersClient. */ +public final class ClustersClientImpl implements ClustersClient { + private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(AvsClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientClusters to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientClusters") + private interface ClustersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterInner cluster, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterUpdate clusterUpdate, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @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); + } + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner get(String resourceGroupName, String privateCloudName, String clusterName) { + return getAsync(resourceGroupName, privateCloudName, clusterName).block(); + } + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, context).block(); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + cluster, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (cluster == null) { + return Mono.error(new IllegalArgumentException("Parameter cluster is required and cannot be null.")); + } else { + cluster.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + cluster, + accept, + context); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, cluster, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster).getSyncPoller(); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster, context) + .getSyncPoller(); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster).block(); + } + + /** + * Create or update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param cluster A cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner createOrUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterInner cluster, Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, clusterName, cluster, context).block(); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterUpdate == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + } else { + clusterUpdate.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + clusterUpdate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterUpdate == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterUpdate is required and cannot be null.")); + } else { + clusterUpdate.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + clusterUpdate, + accept, + context); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).getSyncPoller(); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + Context context) { + return beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context) + .getSyncPoller(); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + Context context) { + return beginUpdateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, String privateCloudName, String clusterName, ClusterUpdate clusterUpdate) { + return updateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate).block(); + } + + /** + * Update a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param clusterUpdate The cluster properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, + String privateCloudName, + String clusterName, + ClusterUpdate clusterUpdate, + Context context) { + return updateAsync(resourceGroupName, privateCloudName, clusterName, clusterUpdate, context).block(); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String clusterName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName).getSyncPoller(); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, context).getSyncPoller(); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String clusterName) { + deleteAsync(resourceGroupName, privateCloudName, clusterName).block(); + } + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, clusterName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of clusters. + */ + @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 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 paged list of clusters. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.java new file mode 100644 index 000000000000..67a4f7972c7b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ClustersImpl.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.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.ClustersClient; +import com.azure.resourcemanager.avs.fluent.models.ClusterInner; +import com.azure.resourcemanager.avs.models.Cluster; +import com.azure.resourcemanager.avs.models.Clusters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClustersImpl implements Clusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public ClustersImpl(ClustersClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public Cluster get(String resourceGroupName, String privateCloudName, String clusterName) { + ClusterInner inner = this.serviceClient().get(resourceGroupName, privateCloudName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String clusterName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, clusterName); + } + + public void delete(String resourceGroupName, String privateCloudName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, clusterName, context); + } + + public Cluster 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, clusterName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, clusterName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, privateCloudName, clusterName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, privateCloudName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java new file mode 100644 index 000000000000..c3fb2a990414 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoreImpl.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.azure.resourcemanager.avs.models.Datastore; +import com.azure.resourcemanager.avs.models.DatastoreProvisioningState; +import com.azure.resourcemanager.avs.models.DiskPoolVolume; +import com.azure.resourcemanager.avs.models.NetAppVolume; + +public final class DatastoreImpl implements Datastore, Datastore.Definition { + private DatastoreInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + DatastoreImpl(DatastoreInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DatastoreProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NetAppVolume netAppVolume() { + return this.innerModel().netAppVolume(); + } + + public DiskPoolVolume diskPoolVolume() { + return this.innerModel().diskPoolVolume(); + } + + public DatastoreInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String clusterName; + + private String datastoreName; + + public DatastoreImpl withExistingCluster(String resourceGroupName, String privateCloudName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + this.clusterName = clusterName; + return this; + } + + public Datastore create() { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .create( + resourceGroupName, privateCloudName, clusterName, datastoreName, this.innerModel(), Context.NONE); + return this; + } + + public Datastore create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .create(resourceGroupName, privateCloudName, clusterName, datastoreName, this.innerModel(), context); + return this; + } + + DatastoreImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new DatastoreInner(); + this.serviceManager = serviceManager; + this.datastoreName = name; + } + + public Datastore refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, Context.NONE) + .getValue(); + return this; + } + + public Datastore refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDatastores() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, context) + .getValue(); + return this; + } + + public DatastoreImpl withNetAppVolume(NetAppVolume netAppVolume) { + this.innerModel().withNetAppVolume(netAppVolume); + return this; + } + + public DatastoreImpl withDiskPoolVolume(DiskPoolVolume diskPoolVolume) { + this.innerModel().withDiskPoolVolume(diskPoolVolume); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java new file mode 100644 index 000000000000..3a1a710f4d23 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresClientImpl.java @@ -0,0 +1,1218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.DatastoresClient; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.azure.resourcemanager.avs.models.DatastoreList; +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 DatastoresClient. */ +public final class DatastoresClientImpl implements DatastoresClient { + private final ClientLogger logger = new ClientLogger(DatastoresClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DatastoresService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of DatastoresClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DatastoresClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(DatastoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientDatastores to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientDatastores") + private interface DatastoresService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DatastoreInner datastore, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("clusterName") String clusterName, + @PathParam("datastoreName") String datastoreName, + @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); + } + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + 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())); + } + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, String clusterName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName)); + } + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, clusterName, context)); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatastoreInner get( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return getAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).block(); + } + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore in a private cloud cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).block(); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + return Mono.error(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + datastore, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + if (datastore == null) { + return Mono.error(new IllegalArgumentException("Parameter datastore is required and cannot be null.")); + } else { + datastore.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + datastore, + accept, + context); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatastoreInner> beginCreateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatastoreInner.class, DatastoreInner.class, Context.NONE); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, DatastoreInner> beginCreateAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), DatastoreInner.class, DatastoreInner.class, context); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatastoreInner> beginCreate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + return beginCreateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore) + .getSyncPoller(); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DatastoreInner> beginCreate( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + return beginCreateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) + .getSyncPoller(); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + return beginCreateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + return beginCreateAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatastoreInner create( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore) { + return createAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore).block(); + } + + /** + * Create a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param datastore A datastore in a private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 datastore resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DatastoreInner create( + String resourceGroupName, + String privateCloudName, + String clusterName, + String datastoreName, + DatastoreInner datastore, + Context context) { + return createAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, datastore, context).block(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (datastoreName == null) { + return Mono.error(new IllegalArgumentException("Parameter datastoreName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + clusterName, + datastoreName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).getSyncPoller(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context) + .getSyncPoller(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + deleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName).block(); + } + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, clusterName, datastoreName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of datastores. + */ + @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 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 paged list of datastores. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java new file mode 100644 index 000000000000..5b9860db13ad --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/DatastoresImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.DatastoresClient; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.azure.resourcemanager.avs.models.Datastore; +import com.azure.resourcemanager.avs.models.Datastores; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DatastoresImpl implements Datastores { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatastoresImpl.class); + + private final DatastoresClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public DatastoresImpl(DatastoresClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, clusterName); + return Utils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new DatastoreImpl(inner1, this.manager())); + } + + public Datastore get(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + DatastoreInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, clusterName, datastoreName); + if (inner != null) { + return new DatastoreImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DatastoreImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, clusterName, datastoreName); + } + + public void delete( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + } + + public Datastore 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + return this + .getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, clusterName, datastoreName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + this.delete(resourceGroupName, privateCloudName, clusterName, datastoreName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String datastoreName = Utils.getValueFromIdByName(id, "datastores"); + if (datastoreName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'datastores'.", id))); + } + this.delete(resourceGroupName, privateCloudName, clusterName, datastoreName, context); + } + + private DatastoresClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public DatastoreImpl define(String name) { + return new DatastoreImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java new file mode 100644 index 000000000000..69b965ed550e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/ExpressRouteAuthorizationImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorization; +import com.azure.resourcemanager.avs.models.ExpressRouteAuthorizationProvisioningState; + +public final class ExpressRouteAuthorizationImpl + implements ExpressRouteAuthorization, ExpressRouteAuthorization.Definition, ExpressRouteAuthorization.Update { + private ExpressRouteAuthorizationInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExpressRouteAuthorizationProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String expressRouteAuthorizationId() { + return this.innerModel().expressRouteAuthorizationId(); + } + + public String expressRouteAuthorizationKey() { + return this.innerModel().expressRouteAuthorizationKey(); + } + + public ExpressRouteAuthorizationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String authorizationName; + + public ExpressRouteAuthorizationImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public ExpressRouteAuthorization create() { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizations() + .createOrUpdate( + resourceGroupName, privateCloudName, authorizationName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteAuthorization create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizations() + .createOrUpdate(resourceGroupName, privateCloudName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRouteAuthorizationImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new ExpressRouteAuthorizationInner(); + this.serviceManager = serviceManager; + this.authorizationName = name; + } + + public ExpressRouteAuthorizationImpl update() { + return this; + } + + public ExpressRouteAuthorization apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizations() + .createOrUpdate( + resourceGroupName, privateCloudName, authorizationName, this.innerModel(), Context.NONE); + return this; + } + + public ExpressRouteAuthorization apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizations() + .createOrUpdate(resourceGroupName, privateCloudName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRouteAuthorizationImpl( + ExpressRouteAuthorizationInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.authorizationName = Utils.getValueFromIdByName(innerObject.id(), "authorizations"); + } + + public ExpressRouteAuthorization refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizations() + .getWithResponse(resourceGroupName, privateCloudName, authorizationName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRouteAuthorization refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAuthorizations() + .getWithResponse(resourceGroupName, privateCloudName, authorizationName, context) + .getValue(); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java new file mode 100644 index 000000000000..af7b3a5be8cb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.azure.resourcemanager.avs.models.GlobalReachConnection; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus; + +public final class GlobalReachConnectionImpl + implements GlobalReachConnection, GlobalReachConnection.Definition, GlobalReachConnection.Update { + private GlobalReachConnectionInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GlobalReachConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String addressPrefix() { + return this.innerModel().addressPrefix(); + } + + public String authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public GlobalReachConnectionStatus circuitConnectionStatus() { + return this.innerModel().circuitConnectionStatus(); + } + + public String peerExpressRouteCircuit() { + return this.innerModel().peerExpressRouteCircuit(); + } + + public GlobalReachConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String globalReachConnectionName; + + public GlobalReachConnectionImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public GlobalReachConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public GlobalReachConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), context); + return this; + } + + GlobalReachConnectionImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new GlobalReachConnectionInner(); + this.serviceManager = serviceManager; + this.globalReachConnectionName = name; + } + + public GlobalReachConnectionImpl update() { + return this; + } + + public GlobalReachConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public GlobalReachConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .createOrUpdate( + resourceGroupName, privateCloudName, globalReachConnectionName, this.innerModel(), context); + return this; + } + + GlobalReachConnectionImpl( + GlobalReachConnectionInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.globalReachConnectionName = Utils.getValueFromIdByName(innerObject.id(), "globalReachConnections"); + } + + public GlobalReachConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, Context.NONE) + .getValue(); + return this; + } + + public GlobalReachConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGlobalReachConnections() + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, context) + .getValue(); + return this; + } + + public GlobalReachConnectionImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public GlobalReachConnectionImpl withPeerExpressRouteCircuit(String peerExpressRouteCircuit) { + this.innerModel().withPeerExpressRouteCircuit(peerExpressRouteCircuit); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java new file mode 100644 index 000000000000..07bb1e085f58 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsClientImpl.java @@ -0,0 +1,1179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.azure.resourcemanager.avs.models.GlobalReachConnectionList; +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 GlobalReachConnectionsClient. */ +public final class GlobalReachConnectionsClientImpl implements GlobalReachConnectionsClient { + private final ClientLogger logger = new ClientLogger(GlobalReachConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final GlobalReachConnectionsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of GlobalReachConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GlobalReachConnectionsClientImpl(AvsClientImpl client) { + this.service = + RestProxy + .create(GlobalReachConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientGlobalReachConnections to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientGlobalReach") + private interface GlobalReachConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GlobalReachConnectionInner globalReachConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/globalReachConnections/{globalReachConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("globalReachConnectionName") String globalReachConnectionName, + @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); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalReachConnectionInner get( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return getAsync(resourceGroupName, privateCloudName, globalReachConnectionName).block(); + } + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).block(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + globalReachConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + if (globalReachConnection == null) { + return Mono + .error(new IllegalArgumentException("Parameter globalReachConnection is required and cannot be null.")); + } else { + globalReachConnection.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + globalReachConnection, + accept, + context); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GlobalReachConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GlobalReachConnectionInner.class, + GlobalReachConnectionInner.class, + Context.NONE); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, GlobalReachConnectionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GlobalReachConnectionInner.class, + GlobalReachConnectionInner.class, + context); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection) + .getSyncPoller(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, GlobalReachConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context) + .getSyncPoller(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection) { + return createOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection) + .block(); + } + + /** + * Create or update a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param globalReachConnection A global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GlobalReachConnectionInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String globalReachConnectionName, + GlobalReachConnectionInner globalReachConnection, + Context context) { + return createOrUpdateAsync( + resourceGroupName, privateCloudName, globalReachConnectionName, globalReachConnection, context) + .block(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (globalReachConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter globalReachConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + globalReachConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).getSyncPoller(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName).block(); + } + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, globalReachConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of global reach connections. + */ + @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 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 paged list of global reach connections. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java new file mode 100644 index 000000000000..7bce17a0f1aa --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/GlobalReachConnectionsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.GlobalReachConnectionsClient; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.azure.resourcemanager.avs.models.GlobalReachConnection; +import com.azure.resourcemanager.avs.models.GlobalReachConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GlobalReachConnectionsImpl implements GlobalReachConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalReachConnectionsImpl.class); + + private final GlobalReachConnectionsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public GlobalReachConnectionsImpl( + GlobalReachConnectionsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new GlobalReachConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new GlobalReachConnectionImpl(inner1, this.manager())); + } + + public GlobalReachConnection get( + String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + GlobalReachConnectionInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, globalReachConnectionName); + if (inner != null) { + return new GlobalReachConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GlobalReachConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, globalReachConnectionName); + } + + public void delete( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, globalReachConnectionName, context); + } + + public GlobalReachConnection 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, globalReachConnectionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + this.delete(resourceGroupName, privateCloudName, globalReachConnectionName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String globalReachConnectionName = Utils.getValueFromIdByName(id, "globalReachConnections"); + if (globalReachConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'globalReachConnections'.", + id))); + } + this.delete(resourceGroupName, privateCloudName, globalReachConnectionName, context); + } + + private GlobalReachConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public GlobalReachConnectionImpl define(String name) { + return new GlobalReachConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java new file mode 100644 index 000000000000..f37632330eac --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSiteImpl.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSite; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteStatus; + +public final class HcxEnterpriseSiteImpl + implements HcxEnterpriseSite, HcxEnterpriseSite.Definition, HcxEnterpriseSite.Update { + private HcxEnterpriseSiteInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String activationKey() { + return this.innerModel().activationKey(); + } + + public HcxEnterpriseSiteStatus status() { + return this.innerModel().status(); + } + + public HcxEnterpriseSiteInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String hcxEnterpriseSiteName; + + public HcxEnterpriseSiteImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public HcxEnterpriseSite create() { + this.innerObject = + serviceManager + .serviceClient() + .getHcxEnterpriseSites() + .createOrUpdateWithResponse( + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public HcxEnterpriseSite create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHcxEnterpriseSites() + .createOrUpdateWithResponse( + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.innerModel(), context) + .getValue(); + return this; + } + + HcxEnterpriseSiteImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new HcxEnterpriseSiteInner(); + this.serviceManager = serviceManager; + this.hcxEnterpriseSiteName = name; + } + + public HcxEnterpriseSiteImpl update() { + return this; + } + + public HcxEnterpriseSite apply() { + this.innerObject = + serviceManager + .serviceClient() + .getHcxEnterpriseSites() + .createOrUpdateWithResponse( + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public HcxEnterpriseSite apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHcxEnterpriseSites() + .createOrUpdateWithResponse( + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, this.innerModel(), context) + .getValue(); + return this; + } + + HcxEnterpriseSiteImpl(HcxEnterpriseSiteInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.hcxEnterpriseSiteName = Utils.getValueFromIdByName(innerObject.id(), "hcxEnterpriseSites"); + } + + public HcxEnterpriseSite refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getHcxEnterpriseSites() + .getWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, Context.NONE) + .getValue(); + return this; + } + + public HcxEnterpriseSite refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getHcxEnterpriseSites() + .getWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context) + .getValue(); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java new file mode 100644 index 000000000000..3a1e8281a061 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesClientImpl.java @@ -0,0 +1,925 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; +import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSiteList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in HcxEnterpriseSitesClient. */ +public final class HcxEnterpriseSitesClientImpl implements HcxEnterpriseSitesClient { + private final ClientLogger logger = new ClientLogger(HcxEnterpriseSitesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final HcxEnterpriseSitesService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of HcxEnterpriseSitesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + HcxEnterpriseSitesClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(HcxEnterpriseSitesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientHcxEnterpriseSites to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientHcxEnterpri") + private interface HcxEnterpriseSitesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/hcxEnterpriseSites") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") HcxEnterpriseSiteInner hcxEnterpriseSite, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("hcxEnterpriseSiteName") String hcxEnterpriseSiteName, + @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); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + 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())); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName)); + } + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + hcxEnterpriseSiteName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + hcxEnterpriseSiteName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return getWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcxEnterpriseSiteInner get(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return getAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).block(); + } + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { + return getWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context).block(); + } + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + if (hcxEnterpriseSite == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSite is required and cannot be null.")); + } else { + hcxEnterpriseSite.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + hcxEnterpriseSiteName, + this.client.getApiVersion(), + hcxEnterpriseSite, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + if (hcxEnterpriseSite == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSite is required and cannot be null.")); + } else { + hcxEnterpriseSite.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + hcxEnterpriseSiteName, + this.client.getApiVersion(), + hcxEnterpriseSite, + accept, + context); + } + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite) { + return createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, hcxEnterpriseSite) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HcxEnterpriseSiteInner createOrUpdate( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, hcxEnterpriseSite) + .block(); + } + + /** + * Create or update an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param hcxEnterpriseSite The HCX Enterprise Site. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String privateCloudName, + String hcxEnterpriseSiteName, + HcxEnterpriseSiteInner hcxEnterpriseSite, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, privateCloudName, hcxEnterpriseSiteName, hcxEnterpriseSite, context) + .block(); + } + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + hcxEnterpriseSiteName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (hcxEnterpriseSiteName == null) { + return Mono + .error(new IllegalArgumentException("Parameter hcxEnterpriseSiteName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + hcxEnterpriseSiteName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + return deleteWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + deleteAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName).block(); + } + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { + return deleteWithResponseAsync(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of HCX Enterprise Sites. + */ + @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 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 paged list of HCX Enterprise Sites. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java new file mode 100644 index 000000000000..f32a7f602279 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/HcxEnterpriseSitesImpl.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.HcxEnterpriseSitesClient; +import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSite; +import com.azure.resourcemanager.avs.models.HcxEnterpriseSites; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class HcxEnterpriseSitesImpl implements HcxEnterpriseSites { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HcxEnterpriseSitesImpl.class); + + private final HcxEnterpriseSitesClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public HcxEnterpriseSitesImpl( + HcxEnterpriseSitesClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateCloudName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new HcxEnterpriseSiteImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new HcxEnterpriseSiteImpl(inner1, this.manager())); + } + + public HcxEnterpriseSite get(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + HcxEnterpriseSiteInner inner = + this.serviceClient().get(resourceGroupName, privateCloudName, hcxEnterpriseSiteName); + if (inner != null) { + return new HcxEnterpriseSiteImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new HcxEnterpriseSiteImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName) { + this.serviceClient().delete(resourceGroupName, privateCloudName, hcxEnterpriseSiteName); + } + + public Response deleteWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context); + } + + public HcxEnterpriseSite 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String hcxEnterpriseSiteName = Utils.getValueFromIdByName(id, "hcxEnterpriseSites"); + if (hcxEnterpriseSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hcxEnterpriseSites'.", id))); + } + return this + .getWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String hcxEnterpriseSiteName = Utils.getValueFromIdByName(id, "hcxEnterpriseSites"); + if (hcxEnterpriseSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hcxEnterpriseSites'.", id))); + } + return this.getWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String hcxEnterpriseSiteName = Utils.getValueFromIdByName(id, "hcxEnterpriseSites"); + if (hcxEnterpriseSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hcxEnterpriseSites'.", id))); + } + this.deleteWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, Context.NONE).getValue(); + } + + public Response 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String hcxEnterpriseSiteName = Utils.getValueFromIdByName(id, "hcxEnterpriseSites"); + if (hcxEnterpriseSiteName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'hcxEnterpriseSites'.", id))); + } + return this.deleteWithResponse(resourceGroupName, privateCloudName, hcxEnterpriseSiteName, context); + } + + private HcxEnterpriseSitesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public HcxEnterpriseSiteImpl define(String name) { + return new HcxEnterpriseSiteImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java new file mode 100644 index 000000000000..3fcb66d6bf91 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsClientImpl.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.LocationsClient; +import com.azure.resourcemanager.avs.fluent.models.QuotaInner; +import com.azure.resourcemanager.avs.fluent.models.TrialInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public final class LocationsClientImpl implements LocationsClient { + private final ClientLogger logger = new ClientLogger(LocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientLocations to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientLocations") + private interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkTrialAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkQuotaAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkTrialAvailabilityWithResponseAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkTrialAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkTrialAvailabilityWithResponseAsync(String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkTrialAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkTrialAvailabilityAsync(String location) { + return checkTrialAvailabilityWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TrialInner checkTrialAvailability(String location) { + return checkTrialAvailabilityAsync(location).block(); + } + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkTrialAvailabilityWithResponse(String location, Context context) { + return checkTrialAvailabilityWithResponseAsync(location, context).block(); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkQuotaAvailabilityWithResponseAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkQuotaAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkQuotaAvailabilityWithResponseAsync(String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkQuotaAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkQuotaAvailabilityAsync(String location) { + return checkQuotaAvailabilityWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaInner checkQuotaAvailability(String location) { + return checkQuotaAvailabilityAsync(location).block(); + } + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkQuotaAvailabilityWithResponse(String location, Context context) { + return checkQuotaAvailabilityWithResponseAsync(location, context).block(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.java new file mode 100644 index 000000000000..111e9ceb7856 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/LocationsImpl.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.avs.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.avs.fluent.LocationsClient; +import com.azure.resourcemanager.avs.fluent.models.QuotaInner; +import com.azure.resourcemanager.avs.fluent.models.TrialInner; +import com.azure.resourcemanager.avs.models.Locations; +import com.azure.resourcemanager.avs.models.Quota; +import com.azure.resourcemanager.avs.models.Trial; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationsImpl implements Locations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public LocationsImpl(LocationsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Trial checkTrialAvailability(String location) { + TrialInner inner = this.serviceClient().checkTrialAvailability(location); + if (inner != null) { + return new TrialImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkTrialAvailabilityWithResponse(String location, Context context) { + Response inner = this.serviceClient().checkTrialAvailabilityWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TrialImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Quota checkQuotaAvailability(String location) { + QuotaInner inner = this.serviceClient().checkQuotaAvailability(location); + if (inner != null) { + return new QuotaImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkQuotaAvailabilityWithResponse(String location, Context context) { + Response inner = this.serviceClient().checkQuotaAvailabilityWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new QuotaImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java new file mode 100644 index 000000000000..bcb062454f2c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.OperationInner; +import com.azure.resourcemanager.avs.models.Operation; +import com.azure.resourcemanager.avs.models.OperationDisplay; +import com.azure.resourcemanager.avs.models.OperationProperties; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..9ac0b1d3586d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.OperationsClient; +import com.azure.resourcemanager.avs.fluent.models.OperationInner; +import com.azure.resourcemanager.avs.models.OperationList; +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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientOperations to be used by the proxy service to perform REST + * calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientOperations") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.AVS/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 of the available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @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 of the available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @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 of the available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 pageable list of operations. + */ + @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 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 pageable list of operations. + */ + @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java new file mode 100644 index 000000000000..af2be43bce46 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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.avs.fluent.OperationsClient; +import com.azure.resourcemanager.avs.fluent.models.OperationInner; +import com.azure.resourcemanager.avs.models.Operation; +import com.azure.resourcemanager.avs.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.avs.AvsManager 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.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java new file mode 100644 index 000000000000..fd274cb2b724 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudImpl.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.models.AdminCredentials; +import com.azure.resourcemanager.avs.models.Circuit; +import com.azure.resourcemanager.avs.models.Endpoints; +import com.azure.resourcemanager.avs.models.IdentitySource; +import com.azure.resourcemanager.avs.models.InternetEnum; +import com.azure.resourcemanager.avs.models.ManagementCluster; +import com.azure.resourcemanager.avs.models.PrivateCloud; +import com.azure.resourcemanager.avs.models.PrivateCloudProvisioningState; +import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; +import com.azure.resourcemanager.avs.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PrivateCloudImpl implements PrivateCloud, PrivateCloud.Definition, PrivateCloud.Update { + private PrivateCloudInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public 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 Sku sku() { + return this.innerModel().sku(); + } + + public ManagementCluster managementCluster() { + return this.innerModel().managementCluster(); + } + + public InternetEnum internet() { + return this.innerModel().internet(); + } + + public List identitySources() { + List inner = this.innerModel().identitySources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateCloudProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Circuit circuit() { + return this.innerModel().circuit(); + } + + public Endpoints endpoints() { + return this.innerModel().endpoints(); + } + + public String networkBlock() { + return this.innerModel().networkBlock(); + } + + public String managementNetwork() { + return this.innerModel().managementNetwork(); + } + + public String provisioningNetwork() { + return this.innerModel().provisioningNetwork(); + } + + public String vmotionNetwork() { + return this.innerModel().vmotionNetwork(); + } + + public String vcenterPassword() { + return this.innerModel().vcenterPassword(); + } + + public String nsxtPassword() { + return this.innerModel().nsxtPassword(); + } + + public String vcenterCertificateThumbprint() { + return this.innerModel().vcenterCertificateThumbprint(); + } + + public String nsxtCertificateThumbprint() { + return this.innerModel().nsxtCertificateThumbprint(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateCloudInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private PrivateCloudUpdate updatePrivateCloudUpdate; + + public PrivateCloudImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PrivateCloud create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateClouds() + .createOrUpdate(resourceGroupName, privateCloudName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateCloud create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateClouds() + .createOrUpdate(resourceGroupName, privateCloudName, this.innerModel(), context); + return this; + } + + PrivateCloudImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new PrivateCloudInner(); + this.serviceManager = serviceManager; + this.privateCloudName = name; + } + + public PrivateCloudImpl update() { + this.updatePrivateCloudUpdate = new PrivateCloudUpdate(); + return this; + } + + public PrivateCloud apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateClouds() + .update(resourceGroupName, privateCloudName, updatePrivateCloudUpdate, Context.NONE); + return this; + } + + public PrivateCloud apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateClouds() + .update(resourceGroupName, privateCloudName, updatePrivateCloudUpdate, context); + return this; + } + + PrivateCloudImpl(PrivateCloudInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + } + + public PrivateCloud refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateClouds() + .getByResourceGroupWithResponse(resourceGroupName, privateCloudName, Context.NONE) + .getValue(); + return this; + } + + public PrivateCloud refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateClouds() + .getByResourceGroupWithResponse(resourceGroupName, privateCloudName, context) + .getValue(); + return this; + } + + public void rotateVcenterPassword() { + serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName); + } + + public void rotateVcenterPassword(Context context) { + serviceManager.privateClouds().rotateVcenterPassword(resourceGroupName, privateCloudName, context); + } + + public void rotateNsxtPassword() { + serviceManager.privateClouds().rotateNsxtPassword(resourceGroupName, privateCloudName); + } + + public void rotateNsxtPassword(Context context) { + serviceManager.privateClouds().rotateNsxtPassword(resourceGroupName, privateCloudName, context); + } + + public AdminCredentials listAdminCredentials() { + return serviceManager.privateClouds().listAdminCredentials(resourceGroupName, privateCloudName); + } + + public Response listAdminCredentialsWithResponse(Context context) { + return serviceManager + .privateClouds() + .listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, context); + } + + public PrivateCloudImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateCloudImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateCloudImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public PrivateCloudImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updatePrivateCloudUpdate.withTags(tags); + return this; + } + } + + public PrivateCloudImpl withManagementCluster(ManagementCluster managementCluster) { + if (isInCreateMode()) { + this.innerModel().withManagementCluster(managementCluster); + return this; + } else { + this.updatePrivateCloudUpdate.withManagementCluster(managementCluster); + return this; + } + } + + public PrivateCloudImpl withInternet(InternetEnum internet) { + if (isInCreateMode()) { + this.innerModel().withInternet(internet); + return this; + } else { + this.updatePrivateCloudUpdate.withInternet(internet); + return this; + } + } + + public PrivateCloudImpl withIdentitySources(List identitySources) { + if (isInCreateMode()) { + this.innerModel().withIdentitySources(identitySources); + return this; + } else { + this.updatePrivateCloudUpdate.withIdentitySources(identitySources); + return this; + } + } + + public PrivateCloudImpl withCircuit(Circuit circuit) { + this.innerModel().withCircuit(circuit); + return this; + } + + public PrivateCloudImpl withNetworkBlock(String networkBlock) { + this.innerModel().withNetworkBlock(networkBlock); + return this; + } + + public PrivateCloudImpl withVcenterPassword(String vcenterPassword) { + this.innerModel().withVcenterPassword(vcenterPassword); + return this; + } + + public PrivateCloudImpl withNsxtPassword(String nsxtPassword) { + this.innerModel().withNsxtPassword(nsxtPassword); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java new file mode 100644 index 000000000000..ce020fa74b97 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java @@ -0,0 +1,2206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; +import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.models.PrivateCloudList; +import com.azure.resourcemanager.avs.models.PrivateCloudUpdate; +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 PrivateCloudsClient. */ +public final class PrivateCloudsClientImpl implements PrivateCloudsClient { + private final ClientLogger logger = new ClientLogger(PrivateCloudsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateCloudsService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of PrivateCloudsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateCloudsClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(PrivateCloudsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientPrivateClouds to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientPrivateClou") + private interface PrivateCloudsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateCloudInner privateCloud, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateCloudUpdate privateCloudUpdate, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/rotateVcenterPassword") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateVcenterPassword( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/rotateNsxtPassword") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateNsxtPassword( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/listAdminCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAdminCredentials( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateCloudName") String privateCloudName, + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listInSubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private clouds in a 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 paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private clouds in a 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 paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List private clouds in a 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 paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List private clouds in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private clouds in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List private clouds in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listInSubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List private clouds in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listInSubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List private clouds in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List private clouds in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String privateCloudName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateCloudName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateCloudInner getByResourceGroup(String resourceGroupName, String privateCloudName) { + return getByResourceGroupAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateCloudName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateCloudName, context).block(); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloud == null) { + return Mono.error(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + } else { + privateCloud.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + privateCloud, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloud == null) { + return Mono.error(new IllegalArgumentException("Parameter privateCloud is required and cannot be null.")); + } else { + privateCloud.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + privateCloud, + accept, + context); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateCloudInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, privateCloud); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateCloudInner.class, PrivateCloudInner.class, Context.NONE); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateCloudInner> beginCreateOrUpdateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, privateCloudName, privateCloud, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateCloudInner.class, PrivateCloudInner.class, context); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateCloudInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud).getSyncPoller(); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateCloudInner> beginCreateOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud, context).getSyncPoller(); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateCloudInner createOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud).block(); + } + + /** + * Create or update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloud The private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateCloudInner createOrUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudInner privateCloud, Context context) { + return createOrUpdateAsync(resourceGroupName, privateCloudName, privateCloud, context).block(); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloudUpdate == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + } else { + privateCloudUpdate.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + privateCloudUpdate, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (privateCloudUpdate == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudUpdate is required and cannot be null.")); + } else { + privateCloudUpdate.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + privateCloudUpdate, + accept, + context); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateCloudInner> beginUpdateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateCloudInner.class, PrivateCloudInner.class, Context.NONE); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateCloudInner> beginUpdateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PrivateCloudInner.class, PrivateCloudInner.class, context); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateCloudInner> beginUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate).getSyncPoller(); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateCloudInner> beginUpdate( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { + return beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context).getSyncPoller(); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { + return beginUpdateAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateCloudInner update( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate) { + return updateAsync(resourceGroupName, privateCloudName, privateCloudUpdate).block(); + } + + /** + * Update a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param privateCloudUpdate The private cloud properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateCloudInner update( + String resourceGroupName, String privateCloudName, PrivateCloudUpdate privateCloudUpdate, Context context) { + return updateAsync(resourceGroupName, privateCloudName, privateCloudUpdate, context).block(); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateCloudName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateCloudName) { + return beginDeleteAsync(resourceGroupName, privateCloudName).getSyncPoller(); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateCloudName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName) { + return beginDeleteAsync(resourceGroupName, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateCloudName, Context context) { + return beginDeleteAsync(resourceGroupName, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName) { + deleteAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateCloudName, Context context) { + deleteAsync(resourceGroupName, privateCloudName, context).block(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateVcenterPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateVcenterPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateVcenterPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateVcenterPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateVcenterPasswordAsync( + String resourceGroupName, String privateCloudName) { + Mono>> mono = + rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateVcenterPasswordAsync( + String resourceGroupName, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateVcenterPasswordWithResponseAsync(resourceGroupName, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateVcenterPassword( + String resourceGroupName, String privateCloudName) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName).getSyncPoller(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateVcenterPassword( + String resourceGroupName, String privateCloudName, Context context) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateVcenterPasswordAsync(String resourceGroupName, String privateCloudName, Context context) { + return beginRotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { + rotateVcenterPasswordAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { + rotateVcenterPasswordAsync(resourceGroupName, privateCloudName, context).block(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateNsxtPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateNsxtPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateNsxtPasswordWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateNsxtPassword( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateNsxtPasswordAsync( + String resourceGroupName, String privateCloudName) { + Mono>> mono = + rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateNsxtPasswordAsync( + String resourceGroupName, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateNsxtPasswordWithResponseAsync(resourceGroupName, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateNsxtPassword( + String resourceGroupName, String privateCloudName) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName).getSyncPoller(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateNsxtPassword( + String resourceGroupName, String privateCloudName, Context context) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).getSyncPoller(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateNsxtPasswordAsync(String resourceGroupName, String privateCloudName, Context context) { + return beginRotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName) { + rotateNsxtPasswordAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { + rotateNsxtPasswordAsync(resourceGroupName, privateCloudName, context).block(); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAdminCredentialsWithResponseAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAdminCredentials( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAdminCredentialsWithResponseAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAdminCredentials( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + privateCloudName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAdminCredentialsAsync(String resourceGroupName, String privateCloudName) { + return listAdminCredentialsWithResponseAsync(resourceGroupName, privateCloudName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdminCredentialsInner listAdminCredentials(String resourceGroupName, String privateCloudName) { + return listAdminCredentialsAsync(resourceGroupName, privateCloudName).block(); + } + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAdminCredentialsWithResponse( + String resourceGroupName, String privateCloudName, Context context) { + return listAdminCredentialsWithResponseAsync(resourceGroupName, privateCloudName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 paged list of private clouds. + */ + @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 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 paged list of private clouds. + */ + @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 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 paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInSubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listInSubscriptionNext(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 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 paged list of private clouds. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInSubscriptionNextSinglePageAsync( + 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 + .listInSubscriptionNext(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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java new file mode 100644 index 000000000000..af80bf751db7 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.PrivateCloudsClient; +import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.azure.resourcemanager.avs.models.AdminCredentials; +import com.azure.resourcemanager.avs.models.PrivateCloud; +import com.azure.resourcemanager.avs.models.PrivateClouds; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateCloudsImpl implements PrivateClouds { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudsImpl.class); + + private final PrivateCloudsClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public PrivateCloudsImpl(PrivateCloudsClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateCloudImpl(inner1, this.manager())); + } + + public PrivateCloud getByResourceGroup(String resourceGroupName, String privateCloudName) { + PrivateCloudInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, privateCloudName); + if (inner != null) { + return new PrivateCloudImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateCloudName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, privateCloudName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateCloudImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String privateCloudName) { + this.serviceClient().delete(resourceGroupName, privateCloudName); + } + + public void delete(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().delete(resourceGroupName, privateCloudName, context); + } + + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName) { + this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName); + } + + public void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().rotateVcenterPassword(resourceGroupName, privateCloudName, context); + } + + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName) { + this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName); + } + + public void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context) { + this.serviceClient().rotateNsxtPassword(resourceGroupName, privateCloudName, context); + } + + public AdminCredentials listAdminCredentials(String resourceGroupName, String privateCloudName) { + AdminCredentialsInner inner = this.serviceClient().listAdminCredentials(resourceGroupName, privateCloudName); + if (inner != null) { + return new AdminCredentialsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listAdminCredentialsWithResponse( + String resourceGroupName, String privateCloudName, Context context) { + Response inner = + this.serviceClient().listAdminCredentialsWithResponse(resourceGroupName, privateCloudName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AdminCredentialsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateCloud 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateCloudName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateCloudName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.delete(resourceGroupName, privateCloudName, 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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.delete(resourceGroupName, privateCloudName, context); + } + + private PrivateCloudsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public PrivateCloudImpl define(String name) { + return new PrivateCloudImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java new file mode 100644 index 000000000000..b36fd06002ea --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/QuotaImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.QuotaInner; +import com.azure.resourcemanager.avs.models.Quota; +import com.azure.resourcemanager.avs.models.QuotaEnabled; +import java.util.Collections; +import java.util.Map; + +public final class QuotaImpl implements Quota { + private QuotaInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + QuotaImpl(QuotaInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map hostsRemaining() { + Map inner = this.innerModel().hostsRemaining(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public QuotaEnabled quotaEnabled() { + return this.innerModel().quotaEnabled(); + } + + public QuotaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java new file mode 100644 index 000000000000..f88b14d500e7 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/TrialImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.TrialInner; +import com.azure.resourcemanager.avs.models.Trial; +import com.azure.resourcemanager.avs.models.TrialStatus; + +public final class TrialImpl implements Trial { + private TrialInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + TrialImpl(TrialInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public TrialStatus status() { + return this.innerModel().status(); + } + + public Integer availableHosts() { + return this.innerModel().availableHosts(); + } + + public TrialInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/Utils.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/Utils.java new file mode 100644 index 000000000000..7c747736c7af --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/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.avs.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 { + 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.size() > 0 && 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, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java new file mode 100644 index 000000000000..6a3e4e16924f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDhcpImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkDhcpImpl + implements WorkloadNetworkDhcp, WorkloadNetworkDhcp.Definition, WorkloadNetworkDhcp.Update { + private WorkloadNetworkDhcpInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List segments() { + List inner = this.innerModel().segments(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkDhcpInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String dhcpId; + + public WorkloadNetworkDhcpImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkDhcp create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDhcp create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDhcpImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkDhcpInner(); + this.serviceManager = serviceManager; + this.dhcpId = name; + } + + public WorkloadNetworkDhcpImpl update() { + return this; + } + + public WorkloadNetworkDhcp apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDhcp apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDhcp(resourceGroupName, privateCloudName, dhcpId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDhcpImpl( + WorkloadNetworkDhcpInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.dhcpId = Utils.getValueFromIdByName(innerObject.id(), "dhcpConfigurations"); + } + + public WorkloadNetworkDhcp refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkDhcp refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context) + .getValue(); + return this; + } + + public WorkloadNetworkDhcpImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkDhcpImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java new file mode 100644 index 000000000000..065a33946b7b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsServiceImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum; +import com.azure.resourcemanager.avs.models.DnsServiceStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServiceProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkDnsServiceImpl + implements WorkloadNetworkDnsService, WorkloadNetworkDnsService.Definition, WorkloadNetworkDnsService.Update { + private WorkloadNetworkDnsServiceInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String dnsServiceIp() { + return this.innerModel().dnsServiceIp(); + } + + public String defaultDnsZone() { + return this.innerModel().defaultDnsZone(); + } + + public List fqdnZones() { + List inner = this.innerModel().fqdnZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DnsServiceLogLevelEnum logLevel() { + return this.innerModel().logLevel(); + } + + public DnsServiceStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkDnsServiceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkDnsServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String dnsServiceId; + + public WorkloadNetworkDnsServiceImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkDnsService create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsServiceImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkDnsServiceInner(); + this.serviceManager = serviceManager; + this.dnsServiceId = name; + } + + public WorkloadNetworkDnsServiceImpl update() { + return this; + } + + public WorkloadNetworkDnsService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsService(resourceGroupName, privateCloudName, dnsServiceId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsServiceImpl( + WorkloadNetworkDnsServiceInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.dnsServiceId = Utils.getValueFromIdByName(innerObject.id(), "dnsServices"); + } + + public WorkloadNetworkDnsService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkDnsService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context) + .getValue(); + return this; + } + + public WorkloadNetworkDnsServiceImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkDnsServiceImpl withDnsServiceIp(String dnsServiceIp) { + this.innerModel().withDnsServiceIp(dnsServiceIp); + return this; + } + + public WorkloadNetworkDnsServiceImpl withDefaultDnsZone(String defaultDnsZone) { + this.innerModel().withDefaultDnsZone(defaultDnsZone); + return this; + } + + public WorkloadNetworkDnsServiceImpl withFqdnZones(List fqdnZones) { + this.innerModel().withFqdnZones(fqdnZones); + return this; + } + + public WorkloadNetworkDnsServiceImpl withLogLevel(DnsServiceLogLevelEnum logLevel) { + this.innerModel().withLogLevel(logLevel); + return this; + } + + public WorkloadNetworkDnsServiceImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java new file mode 100644 index 000000000000..45375171375d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkDnsZoneImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZoneProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkDnsZoneImpl + implements WorkloadNetworkDnsZone, WorkloadNetworkDnsZone.Definition, WorkloadNetworkDnsZone.Update { + private WorkloadNetworkDnsZoneInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List domain() { + List inner = this.innerModel().domain(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List dnsServerIps() { + List inner = this.innerModel().dnsServerIps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String sourceIp() { + return this.innerModel().sourceIp(); + } + + public Long dnsServices() { + return this.innerModel().dnsServices(); + } + + public WorkloadNetworkDnsZoneProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkDnsZoneInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String dnsZoneId; + + public WorkloadNetworkDnsZoneImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkDnsZone create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsZone create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsZoneImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkDnsZoneInner(); + this.serviceManager = serviceManager; + this.dnsZoneId = name; + } + + public WorkloadNetworkDnsZoneImpl update() { + return this; + } + + public WorkloadNetworkDnsZone apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkDnsZone apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateDnsZone(resourceGroupName, privateCloudName, dnsZoneId, this.innerModel(), context); + return this; + } + + WorkloadNetworkDnsZoneImpl( + WorkloadNetworkDnsZoneInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.dnsZoneId = Utils.getValueFromIdByName(innerObject.id(), "dnsZones"); + } + + public WorkloadNetworkDnsZone refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkDnsZone refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context) + .getValue(); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDomain(List domain) { + this.innerModel().withDomain(domain); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDnsServerIps(List dnsServerIps) { + this.innerModel().withDnsServerIps(dnsServerIps); + return this; + } + + public WorkloadNetworkDnsZoneImpl withSourceIp(String sourceIp) { + this.innerModel().withSourceIp(sourceIp); + return this; + } + + public WorkloadNetworkDnsZoneImpl withDnsServices(Long dnsServices) { + this.innerModel().withDnsServices(dnsServices); + return this; + } + + public WorkloadNetworkDnsZoneImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java new file mode 100644 index 000000000000..247cb4768154 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkGatewayImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; + +public final class WorkloadNetworkGatewayImpl implements WorkloadNetworkGateway { + private WorkloadNetworkGatewayInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + WorkloadNetworkGatewayImpl( + WorkloadNetworkGatewayInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String path() { + return this.innerModel().path(); + } + + public WorkloadNetworkGatewayInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.java new file mode 100644 index 000000000000..5c4b88ba6572 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkPortMirroringImpl.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.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum; +import com.azure.resourcemanager.avs.models.PortMirroringStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringProvisioningState; + +public final class WorkloadNetworkPortMirroringImpl + implements WorkloadNetworkPortMirroring, + WorkloadNetworkPortMirroring.Definition, + WorkloadNetworkPortMirroring.Update { + private WorkloadNetworkPortMirroringInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public PortMirroringDirectionEnum direction() { + return this.innerModel().direction(); + } + + public String source() { + return this.innerModel().source(); + } + + public String destination() { + return this.innerModel().destination(); + } + + public PortMirroringStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkPortMirroringProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkPortMirroringInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String portMirroringId; + + public WorkloadNetworkPortMirroringImpl withExistingPrivateCloud( + String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkPortMirroring create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createPortMirroring( + resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkPortMirroring create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createPortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), context); + return this; + } + + WorkloadNetworkPortMirroringImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkPortMirroringInner(); + this.serviceManager = serviceManager; + this.portMirroringId = name; + } + + public WorkloadNetworkPortMirroringImpl update() { + return this; + } + + public WorkloadNetworkPortMirroring apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updatePortMirroring( + resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkPortMirroring apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updatePortMirroring(resourceGroupName, privateCloudName, portMirroringId, this.innerModel(), context); + return this; + } + + WorkloadNetworkPortMirroringImpl( + WorkloadNetworkPortMirroringInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.portMirroringId = Utils.getValueFromIdByName(innerObject.id(), "portMirroringProfiles"); + } + + public WorkloadNetworkPortMirroring refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkPortMirroring refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context) + .getValue(); + return this; + } + + public WorkloadNetworkPortMirroringImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkPortMirroringImpl withDirection(PortMirroringDirectionEnum direction) { + this.innerModel().withDirection(direction); + return this; + } + + public WorkloadNetworkPortMirroringImpl withSource(String source) { + this.innerModel().withSource(source); + return this; + } + + public WorkloadNetworkPortMirroringImpl withDestination(String destination) { + this.innerModel().withDestination(destination); + return this; + } + + public WorkloadNetworkPortMirroringImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java new file mode 100644 index 000000000000..7590a94e302a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkSegmentImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.models.SegmentStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentPortVif; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentProvisioningState; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentSubnet; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkSegmentImpl + implements WorkloadNetworkSegment, WorkloadNetworkSegment.Definition, WorkloadNetworkSegment.Update { + private WorkloadNetworkSegmentInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String connectedGateway() { + return this.innerModel().connectedGateway(); + } + + public WorkloadNetworkSegmentSubnet subnet() { + return this.innerModel().subnet(); + } + + public List portVif() { + List inner = this.innerModel().portVif(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SegmentStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkSegmentProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkSegmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String segmentId; + + public WorkloadNetworkSegmentImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkSegment create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkSegment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), context); + return this; + } + + WorkloadNetworkSegmentImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkSegmentInner(); + this.serviceManager = serviceManager; + this.segmentId = name; + } + + public WorkloadNetworkSegmentImpl update() { + return this; + } + + public WorkloadNetworkSegment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkSegment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateSegments(resourceGroupName, privateCloudName, segmentId, this.innerModel(), context); + return this; + } + + WorkloadNetworkSegmentImpl( + WorkloadNetworkSegmentInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.segmentId = Utils.getValueFromIdByName(innerObject.id(), "segments"); + } + + public WorkloadNetworkSegment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkSegment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context) + .getValue(); + return this; + } + + public WorkloadNetworkSegmentImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkSegmentImpl withConnectedGateway(String connectedGateway) { + this.innerModel().withConnectedGateway(connectedGateway); + return this; + } + + public WorkloadNetworkSegmentImpl withSubnet(WorkloadNetworkSegmentSubnet subnet) { + this.innerModel().withSubnet(subnet); + return this; + } + + public WorkloadNetworkSegmentImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java new file mode 100644 index 000000000000..0a06a88331ef --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVMGroupImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.models.VMGroupStatusEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class WorkloadNetworkVMGroupImpl + implements WorkloadNetworkVMGroup, WorkloadNetworkVMGroup.Definition, WorkloadNetworkVMGroup.Update { + private WorkloadNetworkVMGroupInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public List members() { + List inner = this.innerModel().members(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public VMGroupStatusEnum status() { + return this.innerModel().status(); + } + + public WorkloadNetworkVMGroupProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long revision() { + return this.innerModel().revision(); + } + + public WorkloadNetworkVMGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateCloudName; + + private String vmGroupId; + + public WorkloadNetworkVMGroupImpl withExistingPrivateCloud(String resourceGroupName, String privateCloudName) { + this.resourceGroupName = resourceGroupName; + this.privateCloudName = privateCloudName; + return this; + } + + public WorkloadNetworkVMGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkVMGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .createVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), context); + return this; + } + + WorkloadNetworkVMGroupImpl(String name, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = new WorkloadNetworkVMGroupInner(); + this.serviceManager = serviceManager; + this.vmGroupId = name; + } + + public WorkloadNetworkVMGroupImpl update() { + return this; + } + + public WorkloadNetworkVMGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadNetworkVMGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .updateVMGroup(resourceGroupName, privateCloudName, vmGroupId, this.innerModel(), context); + return this; + } + + WorkloadNetworkVMGroupImpl( + WorkloadNetworkVMGroupInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateCloudName = Utils.getValueFromIdByName(innerObject.id(), "privateClouds"); + this.vmGroupId = Utils.getValueFromIdByName(innerObject.id(), "vmGroups"); + } + + public WorkloadNetworkVMGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE) + .getValue(); + return this; + } + + public WorkloadNetworkVMGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkloadNetworks() + .getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context) + .getValue(); + return this; + } + + public WorkloadNetworkVMGroupImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public WorkloadNetworkVMGroupImpl withMembers(List members) { + this.innerModel().withMembers(members); + return this; + } + + public WorkloadNetworkVMGroupImpl withRevision(Long revision) { + this.innerModel().withRevision(revision); + return this; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java new file mode 100644 index 000000000000..97a8bb2ea3bf --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworkVirtualMachineImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.models.VMTypeEnum; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; + +public final class WorkloadNetworkVirtualMachineImpl implements WorkloadNetworkVirtualMachine { + private WorkloadNetworkVirtualMachineInner innerObject; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + WorkloadNetworkVirtualMachineImpl( + WorkloadNetworkVirtualMachineInner innerObject, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public VMTypeEnum vmType() { + return this.innerModel().vmType(); + } + + public WorkloadNetworkVirtualMachineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java new file mode 100644 index 000000000000..c6d48896eda0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java @@ -0,0 +1,9664 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcpList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsServicesList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZonesList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGatewayList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroringList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegmentsList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupsList; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachinesList; +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 WorkloadNetworksClient. */ +public final class WorkloadNetworksClientImpl implements WorkloadNetworksClient { + private final ClientLogger logger = new ClientLogger(WorkloadNetworksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkloadNetworksService service; + + /** The service client containing this operation class. */ + private final AvsClientImpl client; + + /** + * Initializes an instance of WorkloadNetworksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkloadNetworksClientImpl(AvsClientImpl client) { + this.service = + RestProxy.create(WorkloadNetworksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AvsClientWorkloadNetworks to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AvsClientWorkloadNet") + private interface WorkloadNetworksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSegments( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSegment( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createSegments( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateSegments( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @BodyParam("application/json") WorkloadNetworkSegmentInner workloadNetworkSegment, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/segments/{segmentId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteSegment( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("segmentId") String segmentId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("dhcpId") String dhcpId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dhcpId") String dhcpId, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dhcpId") String dhcpId, + @BodyParam("application/json") WorkloadNetworkDhcpInner workloadNetworkDhcp, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDhcp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dhcpId") String dhcpId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/gateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGateways( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGateway( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("gatewayId") String gatewayId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("portMirroringId") String portMirroringId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createPortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("portMirroringId") String portMirroringId, + @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("portMirroringId") String portMirroringId, + @BodyParam("application/json") WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deletePortMirroring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("portMirroringId") String portMirroringId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVMGroups( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("vmGroupId") String vmGroupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("vmGroupId") String vmGroupId, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("vmGroupId") String vmGroupId, + @BodyParam("application/json") WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteVMGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("vmGroupId") String vmGroupId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/virtualMachines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVirtualMachines( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVirtualMachine( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("virtualMachineId") String virtualMachineId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDnsServices( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsServiceId") String dnsServiceId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsServiceId") String dnsServiceId, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsServiceId") String dnsServiceId, + @BodyParam("application/json") WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDnsService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("dnsServiceId") String dnsServiceId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDnsZones( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsZoneId") String dnsZoneId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsZoneId") String dnsZoneId, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("privateCloudName") String privateCloudName, + @PathParam("dnsZoneId") String dnsZoneId, + @BodyParam("application/json") WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" + + "/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteDnsZone( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("dnsZoneId") String dnsZoneId, + @PathParam("privateCloudName") String privateCloudName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSegmentsNext( + @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> listDhcpNext( + @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> listGatewaysNext( + @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> listPortMirroringNext( + @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> listVMGroupsNext( + @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> listVirtualMachinesNext( + @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> listDnsServicesNext( + @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> listDnsZonesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSegmentsAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listSegmentsNextSinglePageAsync(nextLink)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSegmentsAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listSegmentsSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listSegmentsNextSinglePageAsync(nextLink, context)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSegments(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listSegmentsAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner getSegment(String resourceGroupName, String privateCloudName, String segmentId) { + return getSegmentAsync(resourceGroupName, privateCloudName, segmentId).block(); + } + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + return getSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context).block(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + Mono>> mono = + createSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + Context.NONE); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginCreateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createSegmentsWithResponseAsync( + resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + context); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .getSyncPoller(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginCreateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .getSyncPoller(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginCreateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block(); + } + + /** + * Create a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner createSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return createSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .block(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateSegmentsWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + if (workloadNetworkSegment == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkSegment is required and cannot be null.")); + } else { + workloadNetworkSegment.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateSegments( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + workloadNetworkSegment, + accept, + context); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + Mono>> mono = + updateSegmentsWithResponseAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + Context.NONE); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkSegmentInner> beginUpdateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateSegmentsWithResponseAsync( + resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkSegmentInner.class, + WorkloadNetworkSegmentInner.class, + context); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .getSyncPoller(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkSegmentInner> beginUpdateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .getSyncPoller(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSegmentsAsync( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return beginUpdateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment) { + return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment).block(); + } + + /** + * Create or update a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param workloadNetworkSegment NSX Segment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Segment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkSegmentInner updateSegments( + String resourceGroupName, + String privateCloudName, + String segmentId, + WorkloadNetworkSegmentInner workloadNetworkSegment, + Context context) { + return updateSegmentsAsync(resourceGroupName, privateCloudName, segmentId, workloadNetworkSegment, context) + .block(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteSegmentWithResponseAsync( + String resourceGroupName, String privateCloudName, String segmentId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (segmentId == null) { + return Mono.error(new IllegalArgumentException("Parameter segmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteSegment( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + segmentId, + accept, + context); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId) { + Mono>> mono = + deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteSegmentWithResponseAsync(resourceGroupName, privateCloudName, segmentId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).getSyncPoller(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteSegment( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).getSyncPoller(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteSegmentAsync(String resourceGroupName, String privateCloudName, String segmentId) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteSegmentAsync( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + return beginDeleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { + deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId).block(); + } + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) { + deleteSegmentAsync(resourceGroupName, privateCloudName, segmentId, context).block(); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDhcpAsync(String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listDhcpNextSinglePageAsync(nextLink)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDhcpAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listDhcpSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listDhcpNextSinglePageAsync(nextLink, context)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName)); + } + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDhcp( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listDhcpAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDhcpWithResponseAsync( + String resourceGroupName, String dhcpId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dhcpId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDhcpWithResponseAsync( + String resourceGroupName, String dhcpId, String privateCloudName, 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 (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dhcpId, + privateCloudName, + accept, + context); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDhcpAsync( + String resourceGroupName, String dhcpId, String privateCloudName) { + return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) { + return getDhcpAsync(resourceGroupName, dhcpId, privateCloudName).block(); + } + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context) { + return getDhcpWithResponseAsync(resourceGroupName, dhcpId, privateCloudName, context).block(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + Mono>> mono = + createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + Context.NONE); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginCreateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + context); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).getSyncPoller(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginCreateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .getSyncPoller(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginCreateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block(); + } + + /** + * Create dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner createDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return createDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDhcpWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + if (workloadNetworkDhcp == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadNetworkDhcp is required and cannot be null.")); + } else { + workloadNetworkDhcp.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + workloadNetworkDhcp, + accept, + context); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + Mono>> mono = + updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + Context.NONE); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDhcpInner> beginUpdateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDhcpInner.class, + WorkloadNetworkDhcpInner.class, + context); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).getSyncPoller(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDhcpInner> beginUpdateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .getSyncPoller(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDhcpAsync( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return beginUpdateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp) { + return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp).block(); + } + + /** + * Create or update dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param workloadNetworkDhcp NSX DHCP. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DHCP. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDhcpInner updateDhcp( + String resourceGroupName, + String privateCloudName, + String dhcpId, + WorkloadNetworkDhcpInner workloadNetworkDhcp, + Context context) { + return updateDhcpAsync(resourceGroupName, privateCloudName, dhcpId, workloadNetworkDhcp, context).block(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDhcpWithResponseAsync( + String resourceGroupName, String privateCloudName, String dhcpId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDhcpWithResponseAsync( + String resourceGroupName, String privateCloudName, String dhcpId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dhcpId == null) { + return Mono.error(new IllegalArgumentException("Parameter dhcpId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDhcp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dhcpId, + accept, + context); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDhcpAsync( + String resourceGroupName, String privateCloudName, String dhcpId) { + Mono>> mono = + deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDhcpAsync( + String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteDhcpWithResponseAsync(resourceGroupName, privateCloudName, dhcpId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).getSyncPoller(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDhcp( + String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).getSyncPoller(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDhcpAsync(String resourceGroupName, String privateCloudName, String dhcpId) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDhcpAsync( + String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + return beginDeleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { + deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId).block(); + } + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + deleteDhcpAsync(resourceGroupName, privateCloudName, dhcpId, context).block(); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listGateways( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listGateways( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGatewaysAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listGatewaysNextSinglePageAsync(nextLink)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGatewaysAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listGatewaysSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listGatewaysNextSinglePageAsync(nextLink, context)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGateways(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listGatewaysAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGatewayWithResponseAsync( + String resourceGroupName, String privateCloudName, String gatewayId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + gatewayId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGatewayWithResponseAsync( + String resourceGroupName, String privateCloudName, String gatewayId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (gatewayId == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getGateway( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + gatewayId, + accept, + context); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getGatewayAsync( + String resourceGroupName, String privateCloudName, String gatewayId) { + return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkGatewayInner getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { + return getGatewayAsync(resourceGroupName, privateCloudName, gatewayId).block(); + } + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context) { + return getGatewayWithResponseAsync(resourceGroupName, privateCloudName, gatewayId, context).block(); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPortMirroringAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listPortMirroringNextSinglePageAsync(nextLink)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPortMirroringAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listPortMirroringSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listPortMirroringNextSinglePageAsync(nextLink, context)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listPortMirroringAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPortMirroringWithResponseAsync( + String resourceGroupName, String privateCloudName, String portMirroringId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPortMirroringWithResponseAsync( + String resourceGroupName, String privateCloudName, String portMirroringId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + accept, + context); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPortMirroringAsync( + String resourceGroupName, String privateCloudName, String portMirroringId) { + return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId) { + return getPortMirroringAsync(resourceGroupName, privateCloudName, portMirroringId).block(); + } + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context) { + return getPortMirroringWithResponseAsync(resourceGroupName, privateCloudName, portMirroringId, context).block(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createPortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createPortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createPortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + Mono>> mono = + createPortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + Context.NONE); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createPortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + context); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .getSyncPoller(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginCreatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .getSyncPoller(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createPortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createPortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginCreatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return createPortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .block(); + } + + /** + * Create a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner createPortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return createPortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .block(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePortMirroringWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (workloadNetworkPortMirroring == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkPortMirroring is required and cannot be null.")); + } else { + workloadNetworkPortMirroring.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + portMirroringId, + workloadNetworkPortMirroring, + accept, + context); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + Mono>> mono = + updatePortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + Context.NONE); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePortMirroringWithResponseAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkPortMirroringInner.class, + WorkloadNetworkPortMirroringInner.class, + context); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .getSyncPoller(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkPortMirroringInner> + beginUpdatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .getSyncPoller(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePortMirroringAsync( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return beginUpdatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring) { + return updatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring) + .block(); + } + + /** + * Create or update a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param workloadNetworkPortMirroring NSX port mirroring. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkPortMirroringInner updatePortMirroring( + String resourceGroupName, + String privateCloudName, + String portMirroringId, + WorkloadNetworkPortMirroringInner workloadNetworkPortMirroring, + Context context) { + return updatePortMirroringAsync( + resourceGroupName, privateCloudName, portMirroringId, workloadNetworkPortMirroring, context) + .block(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePortMirroringWithResponseAsync( + String resourceGroupName, String portMirroringId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deletePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + portMirroringId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deletePortMirroringWithResponseAsync( + String resourceGroupName, String portMirroringId, String privateCloudName, 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 (portMirroringId == null) { + return Mono + .error(new IllegalArgumentException("Parameter portMirroringId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deletePortMirroring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + portMirroringId, + privateCloudName, + accept, + context); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName) { + Mono>> mono = + deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deletePortMirroringWithResponseAsync(resourceGroupName, portMirroringId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context) + .getSyncPoller(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deletePortMirroringAsync( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + return beginDeletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { + deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName).block(); + } + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + deletePortMirroringAsync(resourceGroupName, portMirroringId, privateCloudName, context).block(); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVMGroups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVMGroups( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVMGroupsAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listVMGroupsNextSinglePageAsync(nextLink)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVMGroupsAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listVMGroupsSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listVMGroupsNextSinglePageAsync(nextLink, context)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listVMGroupsAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVMGroupWithResponseAsync( + String resourceGroupName, String privateCloudName, String vmGroupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVMGroupWithResponseAsync( + String resourceGroupName, String privateCloudName, String vmGroupId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + accept, + context); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVMGroupAsync( + String resourceGroupName, String privateCloudName, String vmGroupId) { + return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { + return getVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId).block(); + } + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context) { + return getVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, context).block(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + Mono>> mono = + createVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + Context.NONE); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginCreateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createVMGroupWithResponseAsync( + resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + context); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .getSyncPoller(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginCreateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .getSyncPoller(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginCreateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block(); + } + + /** + * Create a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner createVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return createVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .block(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateVMGroupWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (workloadNetworkVMGroup == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkVMGroup is required and cannot be null.")); + } else { + workloadNetworkVMGroup.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + vmGroupId, + workloadNetworkVMGroup, + accept, + context); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + Mono>> mono = + updateVMGroupWithResponseAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + Context.NONE); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkVMGroupInner> beginUpdateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateVMGroupWithResponseAsync( + resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkVMGroupInner.class, + WorkloadNetworkVMGroupInner.class, + context); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .getSyncPoller(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkVMGroupInner> beginUpdateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .getSyncPoller(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateVMGroupAsync( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return beginUpdateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup) { + return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup).block(); + } + + /** + * Create or update a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param workloadNetworkVMGroup NSX VM Group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX VM Group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVMGroupInner updateVMGroup( + String resourceGroupName, + String privateCloudName, + String vmGroupId, + WorkloadNetworkVMGroupInner workloadNetworkVMGroup, + Context context) { + return updateVMGroupAsync(resourceGroupName, privateCloudName, vmGroupId, workloadNetworkVMGroup, context) + .block(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteVMGroupWithResponseAsync( + String resourceGroupName, String vmGroupId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + vmGroupId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteVMGroupWithResponseAsync( + String resourceGroupName, String vmGroupId, String privateCloudName, 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 (vmGroupId == null) { + return Mono.error(new IllegalArgumentException("Parameter vmGroupId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteVMGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + vmGroupId, + privateCloudName, + accept, + context); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteVMGroupAsync( + String resourceGroupName, String vmGroupId, String privateCloudName) { + Mono>> mono = + deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteVMGroupAsync( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteVMGroupWithResponseAsync(resourceGroupName, vmGroupId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteVMGroup( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteVMGroupAsync(String resourceGroupName, String vmGroupId, String privateCloudName) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteVMGroupAsync( + String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + return beginDeleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { + deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName).block(); + } + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + deleteVMGroupAsync(resourceGroupName, vmGroupId, privateCloudName, context).block(); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVirtualMachines( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVirtualMachines( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVirtualMachinesAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listVirtualMachinesSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listVirtualMachinesNextSinglePageAsync(nextLink, context)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listVirtualMachinesAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineWithResponseAsync( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVirtualMachine( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + virtualMachineId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVirtualMachineWithResponseAsync( + String resourceGroupName, String privateCloudName, String virtualMachineId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (virtualMachineId == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualMachineId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVirtualMachine( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + virtualMachineId, + accept, + context); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVirtualMachineAsync( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkVirtualMachineInner getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + return getVirtualMachineAsync(resourceGroupName, privateCloudName, virtualMachineId).block(); + } + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context) { + return getVirtualMachineWithResponseAsync(resourceGroupName, privateCloudName, virtualMachineId, context) + .block(); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDnsServices( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDnsServices( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsServicesAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listDnsServicesNextSinglePageAsync(nextLink)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsServicesAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listDnsServicesSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listDnsServicesNextSinglePageAsync(nextLink, context)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listDnsServicesAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsServiceWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsServiceWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsServiceId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + accept, + context); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDnsServiceAsync( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner getDnsService( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + return getDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId).block(); + } + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context) { + return getDnsServiceWithResponseAsync(resourceGroupName, privateCloudName, dnsServiceId, context).block(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginCreateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + Mono>> mono = + createDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + Context.NONE); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginCreateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + context); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .getSyncPoller(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginCreateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginCreateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .getSyncPoller(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginCreateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginCreateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return createDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .block(); + } + + /** + * Create a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner createDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return createDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .block(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsServiceWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (workloadNetworkDnsService == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter workloadNetworkDnsService is required and cannot be null.")); + } else { + workloadNetworkDnsService.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsServiceId, + workloadNetworkDnsService, + accept, + context); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginUpdateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + Mono>> mono = + updateDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + Context.NONE); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsServiceInner> + beginUpdateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDnsServiceWithResponseAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsServiceInner.class, + WorkloadNetworkDnsServiceInner.class, + context); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .getSyncPoller(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsServiceInner> beginUpdateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginUpdateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .getSyncPoller(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return beginUpdateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsServiceAsync( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return beginUpdateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService) { + return updateDnsServiceAsync(resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService) + .block(); + } + + /** + * Create or update a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param workloadNetworkDnsService NSX DNS Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsServiceInner updateDnsService( + String resourceGroupName, + String privateCloudName, + String dnsServiceId, + WorkloadNetworkDnsServiceInner workloadNetworkDnsService, + Context context) { + return updateDnsServiceAsync( + resourceGroupName, privateCloudName, dnsServiceId, workloadNetworkDnsService, context) + .block(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsServiceWithResponseAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsServiceId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsServiceWithResponseAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName, 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 (dnsServiceId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsServiceId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDnsService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsServiceId, + privateCloudName, + accept, + context); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsServiceAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName) { + Mono>> mono = + deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsServiceAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteDnsServiceWithResponseAsync(resourceGroupName, dnsServiceId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsServiceAsync(String resourceGroupName, String dnsServiceId, String privateCloudName) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsServiceAsync( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + return beginDeleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) { + deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName).block(); + } + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + deleteDnsServiceAsync(resourceGroupName, dnsServiceId, privateCloudName, context).block(); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesSinglePageAsync( + String resourceGroupName, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDnsZones( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesSinglePageAsync( + String resourceGroupName, String privateCloudName, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDnsZones( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsZonesAsync( + String resourceGroupName, String privateCloudName) { + return new PagedFlux<>( + () -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName), + nextLink -> listDnsZonesNextSinglePageAsync(nextLink)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDnsZonesAsync( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedFlux<>( + () -> listDnsZonesSinglePageAsync(resourceGroupName, privateCloudName, context), + nextLink -> listDnsZonesNextSinglePageAsync(nextLink, context)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) { + return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName)); + } + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context) { + return new PagedIterable<>(listDnsZonesAsync(resourceGroupName, privateCloudName, context)); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsZoneWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsZoneId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDnsZoneWithResponseAsync( + String resourceGroupName, String privateCloudName, String dnsZoneId, 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + accept, + context); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDnsZoneAsync( + String resourceGroupName, String privateCloudName, String dnsZoneId) { + return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) { + return getDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId).block(); + } + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context) { + return getDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, context).block(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + Mono>> mono = + createDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + Context.NONE); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createDnsZoneWithResponseAsync( + resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + context); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .getSyncPoller(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginCreateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .getSyncPoller(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginCreateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block(); + } + + /** + * Create a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner createDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return createDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .block(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateDnsZoneWithResponseAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + 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 (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (workloadNetworkDnsZone == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadNetworkDnsZone is required and cannot be null.")); + } else { + workloadNetworkDnsZone.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + privateCloudName, + dnsZoneId, + workloadNetworkDnsZone, + accept, + context); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + Mono>> mono = + updateDnsZoneWithResponseAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + Context.NONE); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadNetworkDnsZoneInner> beginUpdateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateDnsZoneWithResponseAsync( + resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadNetworkDnsZoneInner.class, + WorkloadNetworkDnsZoneInner.class, + context); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .getSyncPoller(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadNetworkDnsZoneInner> beginUpdateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .getSyncPoller(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateDnsZoneAsync( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return beginUpdateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone) { + return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone).block(); + } + + /** + * Create or update a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param workloadNetworkDnsZone NSX DNS Zone. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nSX DNS Zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadNetworkDnsZoneInner updateDnsZone( + String resourceGroupName, + String privateCloudName, + String dnsZoneId, + WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, + Context context) { + return updateDnsZoneAsync(resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context) + .block(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsZoneWithResponseAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsZoneId, + privateCloudName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteDnsZoneWithResponseAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName, 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 (dnsZoneId == null) { + return Mono.error(new IllegalArgumentException("Parameter dnsZoneId is required and cannot be null.")); + } + if (privateCloudName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateCloudName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteDnsZone( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + dnsZoneId, + privateCloudName, + accept, + context); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsZoneAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName) { + Mono>> mono = + deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteDnsZoneAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteDnsZoneWithResponseAsync(resourceGroupName, dnsZoneId, privateCloudName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).getSyncPoller(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteDnsZone( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).getSyncPoller(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsZoneAsync(String resourceGroupName, String dnsZoneId, String privateCloudName) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteDnsZoneAsync( + String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + return beginDeleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) { + deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName).block(); + } + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + deleteDnsZoneAsync(resourceGroupName, dnsZoneId, privateCloudName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSegmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX Segments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSegmentsNextSinglePageAsync( + 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 + .listSegmentsNext(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 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 NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDhcpNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX dhcp entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDhcpNextSinglePageAsync( + 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 + .listDhcpNext(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 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 NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGatewaysNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX Gateways. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGatewaysNextSinglePageAsync( + 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 + .listGatewaysNext(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 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 NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listPortMirroringNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX Port Mirroring. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPortMirroringNextSinglePageAsync( + 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 + .listPortMirroringNext(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 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 NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVMGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX VM Groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVMGroupsNextSinglePageAsync( + 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 + .listVMGroupsNext(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 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 NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listVirtualMachinesNext(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 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 NSX Virtual Machines. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVirtualMachinesNextSinglePageAsync( + 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 + .listVirtualMachinesNext(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 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 NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDnsServicesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX DNS Services. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsServicesNextSinglePageAsync( + 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 + .listDnsServicesNext(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 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 NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDnsZonesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>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 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 NSX DNS Zones. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDnsZonesNextSinglePageAsync( + 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 + .listDnsZonesNext(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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java new file mode 100644 index 000000000000..a42f576d583e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksImpl.java @@ -0,0 +1,1086 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.WorkloadNetworksClient; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDhcp; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsService; +import com.azure.resourcemanager.avs.models.WorkloadNetworkDnsZone; +import com.azure.resourcemanager.avs.models.WorkloadNetworkGateway; +import com.azure.resourcemanager.avs.models.WorkloadNetworkPortMirroring; +import com.azure.resourcemanager.avs.models.WorkloadNetworkSegment; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroup; +import com.azure.resourcemanager.avs.models.WorkloadNetworkVirtualMachine; +import com.azure.resourcemanager.avs.models.WorkloadNetworks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkloadNetworksImpl implements WorkloadNetworks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworksImpl.class); + + private final WorkloadNetworksClient innerClient; + + private final com.azure.resourcemanager.avs.AvsManager serviceManager; + + public WorkloadNetworksImpl( + WorkloadNetworksClient innerClient, com.azure.resourcemanager.avs.AvsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listSegments(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listSegments(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkSegmentImpl(inner1, this.manager())); + } + + public PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listSegments(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkSegmentImpl(inner1, this.manager())); + } + + public WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String segmentId) { + WorkloadNetworkSegmentInner inner = + this.serviceClient().getSegment(resourceGroupName, privateCloudName, segmentId); + if (inner != null) { + return new WorkloadNetworkSegmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context) { + Response inner = + this.serviceClient().getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkSegmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId) { + this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, segmentId); + } + + public void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context) { + this.serviceClient().deleteSegment(resourceGroupName, privateCloudName, segmentId, context); + } + + public PagedIterable listDhcp(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listDhcp(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDhcpImpl(inner1, this.manager())); + } + + public PagedIterable listDhcp( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listDhcp(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDhcpImpl(inner1, this.manager())); + } + + public WorkloadNetworkDhcp getDhcp(String resourceGroupName, String dhcpId, String privateCloudName) { + WorkloadNetworkDhcpInner inner = this.serviceClient().getDhcp(resourceGroupName, dhcpId, privateCloudName); + if (inner != null) { + return new WorkloadNetworkDhcpImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context) { + Response inner = + this.serviceClient().getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkDhcpImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId) { + this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, dhcpId); + } + + public void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context) { + this.serviceClient().deleteDhcp(resourceGroupName, privateCloudName, dhcpId, context); + } + + public PagedIterable listGateways(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listGateways(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listGateways(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkGatewayImpl(inner1, this.manager())); + } + + public WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String gatewayId) { + WorkloadNetworkGatewayInner inner = + this.serviceClient().getGateway(resourceGroupName, privateCloudName, gatewayId); + if (inner != null) { + return new WorkloadNetworkGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context) { + Response inner = + this.serviceClient().getGatewayWithResponse(resourceGroupName, privateCloudName, gatewayId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkGatewayImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkPortMirroringImpl(inner1, this.manager())); + } + + public PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listPortMirroring(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkPortMirroringImpl(inner1, this.manager())); + } + + public WorkloadNetworkPortMirroring getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId) { + WorkloadNetworkPortMirroringInner inner = + this.serviceClient().getPortMirroring(resourceGroupName, privateCloudName, portMirroringId); + if (inner != null) { + return new WorkloadNetworkPortMirroringImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context) { + Response inner = + this + .serviceClient() + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkPortMirroringImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName) { + this.serviceClient().deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName); + } + + public void deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context) { + this.serviceClient().deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context); + } + + public PagedIterable listVMGroups(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listVMGroups(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVMGroupImpl(inner1, this.manager())); + } + + public PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listVMGroups(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVMGroupImpl(inner1, this.manager())); + } + + public WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId) { + WorkloadNetworkVMGroupInner inner = + this.serviceClient().getVMGroup(resourceGroupName, privateCloudName, vmGroupId); + if (inner != null) { + return new WorkloadNetworkVMGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context) { + Response inner = + this.serviceClient().getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkVMGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName) { + this.serviceClient().deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName); + } + + public void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context) { + this.serviceClient().deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context); + } + + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVirtualMachineImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listVirtualMachines(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkVirtualMachineImpl(inner1, this.manager())); + } + + public WorkloadNetworkVirtualMachine getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId) { + WorkloadNetworkVirtualMachineInner inner = + this.serviceClient().getVirtualMachine(resourceGroupName, privateCloudName, virtualMachineId); + if (inner != null) { + return new WorkloadNetworkVirtualMachineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context) { + Response inner = + this + .serviceClient() + .getVirtualMachineWithResponse(resourceGroupName, privateCloudName, virtualMachineId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkVirtualMachineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listDnsServices(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listDnsServices(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsServiceImpl(inner1, this.manager())); + } + + public PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listDnsServices(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsServiceImpl(inner1, this.manager())); + } + + public WorkloadNetworkDnsService getDnsService( + String resourceGroupName, String privateCloudName, String dnsServiceId) { + WorkloadNetworkDnsServiceInner inner = + this.serviceClient().getDnsService(resourceGroupName, privateCloudName, dnsServiceId); + if (inner != null) { + return new WorkloadNetworkDnsServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context) { + Response inner = + this.serviceClient().getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkDnsServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName) { + this.serviceClient().deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName); + } + + public void deleteDnsService( + String resourceGroupName, String dnsServiceId, String privateCloudName, Context context) { + this.serviceClient().deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context); + } + + public PagedIterable listDnsZones(String resourceGroupName, String privateCloudName) { + PagedIterable inner = + this.serviceClient().listDnsZones(resourceGroupName, privateCloudName); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsZoneImpl(inner1, this.manager())); + } + + public PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context) { + PagedIterable inner = + this.serviceClient().listDnsZones(resourceGroupName, privateCloudName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadNetworkDnsZoneImpl(inner1, this.manager())); + } + + public WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId) { + WorkloadNetworkDnsZoneInner inner = + this.serviceClient().getDnsZone(resourceGroupName, privateCloudName, dnsZoneId); + if (inner != null) { + return new WorkloadNetworkDnsZoneImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context) { + Response inner = + this.serviceClient().getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadNetworkDnsZoneImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName) { + this.serviceClient().deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName); + } + + public void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context) { + this.serviceClient().deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context); + } + + public WorkloadNetworkSegment getSegmentById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + return this.getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, Context.NONE).getValue(); + } + + public Response getSegmentByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + return this.getSegmentWithResponse(resourceGroupName, privateCloudName, segmentId, context); + } + + public WorkloadNetworkDhcp getDhcpById(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 dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + return this.getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, Context.NONE).getValue(); + } + + public Response getDhcpByIdWithResponse(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 dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + return this.getDhcpWithResponse(resourceGroupName, dhcpId, privateCloudName, context); + } + + public WorkloadNetworkPortMirroring getPortMirroringById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + return this + .getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, Context.NONE) + .getValue(); + } + + public Response getPortMirroringByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + return this.getPortMirroringWithResponse(resourceGroupName, privateCloudName, portMirroringId, context); + } + + public WorkloadNetworkVMGroup getVMGroupById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, Context.NONE).getValue(); + } + + public Response getVMGroupByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + return this.getVMGroupWithResponse(resourceGroupName, privateCloudName, vmGroupId, context); + } + + public WorkloadNetworkDnsService getDnsServiceById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + return this + .getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, Context.NONE) + .getValue(); + } + + public Response getDnsServiceByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + return this.getDnsServiceWithResponse(resourceGroupName, privateCloudName, dnsServiceId, context); + } + + public WorkloadNetworkDnsZone getDnsZoneById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, Context.NONE).getValue(); + } + + public Response getDnsZoneByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + return this.getDnsZoneWithResponse(resourceGroupName, privateCloudName, dnsZoneId, context); + } + + public void deleteSegmentById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + this.deleteSegment(resourceGroupName, privateCloudName, segmentId, Context.NONE); + } + + public void deleteSegmentByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String segmentId = Utils.getValueFromIdByName(id, "segments"); + if (segmentId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'segments'.", id))); + } + this.deleteSegment(resourceGroupName, privateCloudName, segmentId, context); + } + + public void deleteDhcpById(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + this.deleteDhcp(resourceGroupName, privateCloudName, dhcpId, Context.NONE); + } + + public void deleteDhcpByIdWithResponse(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 privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + String dhcpId = Utils.getValueFromIdByName(id, "dhcpConfigurations"); + if (dhcpId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'dhcpConfigurations'.", id))); + } + this.deleteDhcp(resourceGroupName, privateCloudName, dhcpId, context); + } + + public void deletePortMirroringById(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 portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, Context.NONE); + } + + public void deletePortMirroringByIdWithResponse(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 portMirroringId = Utils.getValueFromIdByName(id, "portMirroringProfiles"); + if (portMirroringId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'portMirroringProfiles'.", + id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deletePortMirroring(resourceGroupName, portMirroringId, privateCloudName, context); + } + + public void deleteVMGroupById(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 vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, Context.NONE); + } + + public void deleteVMGroupByIdWithResponse(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 vmGroupId = Utils.getValueFromIdByName(id, "vmGroups"); + if (vmGroupId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vmGroups'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteVMGroup(resourceGroupName, vmGroupId, privateCloudName, context); + } + + public void deleteDnsServiceById(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 dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, Context.NONE); + } + + public void deleteDnsServiceByIdWithResponse(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 dnsServiceId = Utils.getValueFromIdByName(id, "dnsServices"); + if (dnsServiceId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsServices'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsService(resourceGroupName, dnsServiceId, privateCloudName, context); + } + + public void deleteDnsZoneById(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 dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, Context.NONE); + } + + public void deleteDnsZoneByIdWithResponse(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 dnsZoneId = Utils.getValueFromIdByName(id, "dnsZones"); + if (dnsZoneId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'dnsZones'.", id))); + } + String privateCloudName = Utils.getValueFromIdByName(id, "privateClouds"); + if (privateCloudName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'privateClouds'.", id))); + } + this.deleteDnsZone(resourceGroupName, dnsZoneId, privateCloudName, context); + } + + private WorkloadNetworksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.avs.AvsManager manager() { + return this.serviceManager; + } + + public WorkloadNetworkSegmentImpl defineSegments(String name) { + return new WorkloadNetworkSegmentImpl(name, this.manager()); + } + + public WorkloadNetworkDhcpImpl defineDhcp(String name) { + return new WorkloadNetworkDhcpImpl(name, this.manager()); + } + + public WorkloadNetworkPortMirroringImpl definePortMirroring(String name) { + return new WorkloadNetworkPortMirroringImpl(name, this.manager()); + } + + public WorkloadNetworkVMGroupImpl defineVMGroup(String name) { + return new WorkloadNetworkVMGroupImpl(name, this.manager()); + } + + public WorkloadNetworkDnsServiceImpl defineDnsService(String name) { + return new WorkloadNetworkDnsServiceImpl(name, this.manager()); + } + + public WorkloadNetworkDnsZoneImpl defineDnsZone(String name) { + return new WorkloadNetworkDnsZoneImpl(name, this.manager()); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/package-info.java new file mode 100644 index 000000000000..98dd9ee386eb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/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 AvsClient. Azure VMware Solution API. */ +package com.azure.resourcemanager.avs.implementation; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java new file mode 100644 index 000000000000..873dfc5e3f7d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addon.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; + +/** An immutable client-side representation of Addon. */ +public interface Addon { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the licenseKey property: The SRM license. + * + * @return the licenseKey value. + */ + String licenseKey(); + + /** + * Gets the addonType property: The type of private cloud addon. + * + * @return the addonType value. + */ + AddonType addonType(); + + /** + * Gets the provisioningState property: The state of the addon provisioning. + * + * @return the provisioningState value. + */ + AddonProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.AddonInner object. + * + * @return the inner object. + */ + AddonInner innerModel(); + + /** The entirety of the Addon definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Addon definition stages. */ + interface DefinitionStages { + /** The first stage of the Addon definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Addon definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the Addon definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithLicenseKey, DefinitionStages.WithAddonType { + /** + * Executes the create request. + * + * @return the created resource. + */ + Addon create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Addon create(Context context); + } + /** The stage of the Addon definition allowing to specify licenseKey. */ + interface WithLicenseKey { + /** + * Specifies the licenseKey property: The SRM license. + * + * @param licenseKey The SRM license. + * @return the next definition stage. + */ + WithCreate withLicenseKey(String licenseKey); + } + /** The stage of the Addon definition allowing to specify addonType. */ + interface WithAddonType { + /** + * Specifies the addonType property: The type of private cloud addon. + * + * @param addonType The type of private cloud addon. + * @return the next definition stage. + */ + WithCreate withAddonType(AddonType addonType); + } + } + /** + * Begins update for the Addon resource. + * + * @return the stage of resource update. + */ + Addon.Update update(); + + /** The template for Addon update. */ + interface Update extends UpdateStages.WithLicenseKey, UpdateStages.WithAddonType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Addon apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Addon apply(Context context); + } + /** The Addon update stages. */ + interface UpdateStages { + /** The stage of the Addon update allowing to specify licenseKey. */ + interface WithLicenseKey { + /** + * Specifies the licenseKey property: The SRM license. + * + * @param licenseKey The SRM license. + * @return the next definition stage. + */ + Update withLicenseKey(String licenseKey); + } + /** The stage of the Addon update allowing to specify addonType. */ + interface WithAddonType { + /** + * Specifies the addonType property: The type of private cloud addon. + * + * @param addonType The type of private cloud addon. + * @return the next definition stage. + */ + Update withAddonType(AddonType addonType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Addon refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Addon refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java new file mode 100644 index 000000000000..abec9b8b2c5a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.AddonInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of addons. */ +@Immutable +public final class AddonList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.java new file mode 100644 index 000000000000..d9b0df201753 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProperties.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an addon that may be updated. */ +@Fluent +public final class AddonProperties extends AddonSrmProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonProperties.class); + + /* + * The type of private cloud addon + */ + @JsonProperty(value = "addonType") + private AddonType addonType; + + /* + * The state of the addon provisioning + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AddonProvisioningState provisioningState; + + /** + * Get the addonType property: The type of private cloud addon. + * + * @return the addonType value. + */ + public AddonType addonType() { + return this.addonType; + } + + /** + * Set the addonType property: The type of private cloud addon. + * + * @param addonType the addonType value to set. + * @return the AddonProperties object itself. + */ + public AddonProperties withAddonType(AddonType addonType) { + this.addonType = addonType; + return this; + } + + /** + * Get the provisioningState property: The state of the addon provisioning. + * + * @return the provisioningState value. + */ + public AddonProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public AddonProperties withLicenseKey(String licenseKey) { + super.withLicenseKey(licenseKey); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.java new file mode 100644 index 000000000000..e5149cb2d39c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AddonProvisioningState. */ +public final class AddonProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AddonProvisioningState. */ + public static final AddonProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AddonProvisioningState. */ + public static final AddonProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for AddonProvisioningState. */ + public static final AddonProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Building for AddonProvisioningState. */ + public static final AddonProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for AddonProvisioningState. */ + public static final AddonProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for AddonProvisioningState. */ + public static final AddonProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a AddonProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddonProvisioningState. + */ + @JsonCreator + public static AddonProvisioningState fromString(String name) { + return fromString(name, AddonProvisioningState.class); + } + + /** @return known AddonProvisioningState values. */ + public static Collection values() { + return values(AddonProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.java new file mode 100644 index 000000000000..1a6d24f8843d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonSrmProperties.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of an SRM addon that may be updated. */ +@Fluent +public class AddonSrmProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AddonSrmProperties.class); + + /* + * The SRM license + */ + @JsonProperty(value = "licenseKey") + private String licenseKey; + + /** + * Get the licenseKey property: The SRM license. + * + * @return the licenseKey value. + */ + public String licenseKey() { + return this.licenseKey; + } + + /** + * Set the licenseKey property: The SRM license. + * + * @param licenseKey the licenseKey value to set. + * @return the AddonSrmProperties object itself. + */ + public AddonSrmProperties withLicenseKey(String licenseKey) { + this.licenseKey = licenseKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.java new file mode 100644 index 000000000000..c0350dacac1b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AddonType.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AddonType. */ +public final class AddonType extends ExpandableStringEnum { + /** Static value SRM for AddonType. */ + public static final AddonType SRM = fromString("SRM"); + + /** Static value VR for AddonType. */ + public static final AddonType VR = fromString("VR"); + + /** + * Creates or finds a AddonType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddonType. + */ + @JsonCreator + public static AddonType fromString(String name) { + return fromString(name, AddonType.class); + } + + /** @return known AddonType values. */ + public static Collection values() { + return values(AddonType.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java new file mode 100644 index 000000000000..d13c1a4397a5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Addons.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Addons. */ +public interface Addons { + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List addons in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of addons. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + Addon get(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Get an addon by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an addon by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String addonName); + + /** + * Delete a addon in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param addonName Name of the addon for the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String addonName, Context context); + + /** + * Get an addon by name in a private cloud. + * + * @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 an addon by name in a private cloud. + */ + Addon getById(String id); + + /** + * Get an addon by name in a private cloud. + * + * @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 an addon by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a addon in a private cloud. + * + * @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); + + /** + * Delete a addon in a private cloud. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Addon resource. + * + * @param name resource name. + * @return the first stage of the new Addon definition. + */ + Addon.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java new file mode 100644 index 000000000000..c8136800d204 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/AdminCredentials.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner; + +/** An immutable client-side representation of AdminCredentials. */ +public interface AdminCredentials { + /** + * Gets the nsxtUsername property: NSX-T Manager username. + * + * @return the nsxtUsername value. + */ + String nsxtUsername(); + + /** + * Gets the nsxtPassword property: NSX-T Manager password. + * + * @return the nsxtPassword value. + */ + String nsxtPassword(); + + /** + * Gets the vcenterUsername property: vCenter admin username. + * + * @return the vcenterUsername value. + */ + String vcenterUsername(); + + /** + * Gets the vcenterPassword property: vCenter admin password. + * + * @return the vcenterPassword value. + */ + String vcenterPassword(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.AdminCredentialsInner object. + * + * @return the inner object. + */ + AdminCredentialsInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java new file mode 100644 index 000000000000..159cd5a22ac7 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Authorizations.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 Authorizations. */ +public interface Authorizations { + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List ExpressRoute Circuit Authorizations in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of ExpressRoute Circuit Authorizations. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + ExpressRouteAuthorization get(String resourceGroupName, String privateCloudName, String authorizationName); + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an ExpressRoute Circuit Authorization by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String authorizationName, Context context); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String authorizationName); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param authorizationName Name of the ExpressRoute Circuit Authorization in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String authorizationName, Context context); + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @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 an ExpressRoute Circuit Authorization by name in a private cloud. + */ + ExpressRouteAuthorization getById(String id); + + /** + * Get an ExpressRoute Circuit Authorization by name in a private cloud. + * + * @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 an ExpressRoute Circuit Authorization by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @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); + + /** + * Delete an ExpressRoute Circuit Authorization in a private cloud. + * + * @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 ExpressRouteAuthorization resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRouteAuthorization definition. + */ + ExpressRouteAuthorization.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.java new file mode 100644 index 000000000000..3170b471158b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Circuit.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An ExpressRoute Circuit. */ +@Immutable +public final class Circuit { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Circuit.class); + + /* + * CIDR of primary subnet + */ + @JsonProperty(value = "primarySubnet", access = JsonProperty.Access.WRITE_ONLY) + private String primarySubnet; + + /* + * CIDR of secondary subnet + */ + @JsonProperty(value = "secondarySubnet", access = JsonProperty.Access.WRITE_ONLY) + private String secondarySubnet; + + /* + * Identifier of the ExpressRoute Circuit (Microsoft Colo only) + */ + @JsonProperty(value = "expressRouteID", access = JsonProperty.Access.WRITE_ONLY) + private String expressRouteId; + + /* + * ExpressRoute Circuit private peering identifier + */ + @JsonProperty(value = "expressRoutePrivatePeeringID", access = JsonProperty.Access.WRITE_ONLY) + private String expressRoutePrivatePeeringId; + + /** + * Get the primarySubnet property: CIDR of primary subnet. + * + * @return the primarySubnet value. + */ + public String primarySubnet() { + return this.primarySubnet; + } + + /** + * Get the secondarySubnet property: CIDR of secondary subnet. + * + * @return the secondarySubnet value. + */ + public String secondarySubnet() { + return this.secondarySubnet; + } + + /** + * Get the expressRouteId property: Identifier of the ExpressRoute Circuit (Microsoft Colo only). + * + * @return the expressRouteId value. + */ + public String expressRouteId() { + return this.expressRouteId; + } + + /** + * Get the expressRoutePrivatePeeringId property: ExpressRoute Circuit private peering identifier. + * + * @return the expressRoutePrivatePeeringId value. + */ + public String expressRoutePrivatePeeringId() { + return this.expressRoutePrivatePeeringId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java new file mode 100644 index 000000000000..0367c557150b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Cluster.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ClusterInner; +import java.util.List; + +/** An immutable client-side representation of Cluster. */ +public interface Cluster { + /** + * 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 sku property: The cluster SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the provisioningState property: The state of the cluster provisioning. + * + * @return the provisioningState value. + */ + ClusterProvisioningState provisioningState(); + + /** + * Gets the clusterSize property: The cluster size. + * + * @return the clusterSize value. + */ + Integer clusterSize(); + + /** + * Gets the clusterId property: The identity. + * + * @return the clusterId value. + */ + Integer clusterId(); + + /** + * Gets the hosts property: The hosts. + * + * @return the hosts value. + */ + List hosts(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Cluster definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithSku withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** The stage of the Cluster definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The cluster SKU. + * + * @param sku The cluster SKU. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the Cluster 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.WithClusterSize { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + /** The stage of the Cluster definition allowing to specify clusterSize. */ + interface WithClusterSize { + /** + * Specifies the clusterSize property: The cluster size. + * + * @param clusterSize The cluster size. + * @return the next definition stage. + */ + WithCreate withClusterSize(Integer clusterSize); + } + } + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** The template for Cluster update. */ + interface Update extends UpdateStages.WithClusterSize { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + /** The Cluster update stages. */ + interface UpdateStages { + /** The stage of the Cluster update allowing to specify clusterSize. */ + interface WithClusterSize { + /** + * Specifies the clusterSize property: The cluster size. + * + * @param clusterSize The cluster size. + * @return the next definition stage. + */ + Update withClusterSize(Integer clusterSize); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java new file mode 100644 index 000000000000..076d3182e445 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.ClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of clusters. */ +@Immutable +public final class ClusterList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java new file mode 100644 index 000000000000..ead58744acfd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProperties.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The properties of a cluster. */ +@Immutable +public final class ClusterProperties extends CommonClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterProperties.class); + + /** {@inheritDoc} */ + @Override + public ClusterProperties withClusterSize(Integer clusterSize) { + super.withClusterSize(clusterSize); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java new file mode 100644 index 000000000000..4e09de3e0a53 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterProvisioningState. */ +public final class ClusterProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ClusterProvisioningState. */ + public static final ClusterProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ClusterProvisioningState. */ + public static final ClusterProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for ClusterProvisioningState. */ + public static final ClusterProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Deleting for ClusterProvisioningState. */ + public static final ClusterProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for ClusterProvisioningState. */ + public static final ClusterProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ClusterProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterProvisioningState. + */ + @JsonCreator + public static ClusterProvisioningState fromString(String name) { + return fromString(name, ClusterProvisioningState.class); + } + + /** @return known ClusterProvisioningState values. */ + public static Collection values() { + return values(ClusterProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.java new file mode 100644 index 000000000000..5a4a6bb8bef9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ClusterUpdate.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An update of a cluster resource. */ +@JsonFlatten +@Fluent +public class ClusterUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterUpdate.class); + + /* + * The cluster size + */ + @JsonProperty(value = "properties.clusterSize") + private Integer clusterSize; + + /** + * Get the clusterSize property: The cluster size. + * + * @return the clusterSize value. + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the clusterSize property: The cluster size. + * + * @param clusterSize the clusterSize value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java new file mode 100644 index 000000000000..a910e6e8bc53 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Clusters.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 Clusters. */ +public interface Clusters { + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List clusters in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of clusters. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + Cluster get(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * Get a cluster by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * Delete a cluster in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Get a cluster by name in a private cloud. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + Cluster getById(String id); + + /** + * Get a cluster by name in a private cloud. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a cluster by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a cluster in a private cloud. + * + * @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); + + /** + * Delete a cluster in a private cloud. + * + * @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 Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java new file mode 100644 index 000000000000..20bd5bad96b2 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/CommonClusterProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The common properties of a cluster. */ +@Fluent +public class CommonClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CommonClusterProperties.class); + + /* + * The state of the cluster provisioning + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterProvisioningState provisioningState; + + /* + * The cluster size + */ + @JsonProperty(value = "clusterSize") + private Integer clusterSize; + + /* + * The identity + */ + @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY) + private Integer clusterId; + + /* + * The hosts + */ + @JsonProperty(value = "hosts", access = JsonProperty.Access.WRITE_ONLY) + private List hosts; + + /** + * Get the provisioningState property: The state of the cluster provisioning. + * + * @return the provisioningState value. + */ + public ClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterSize property: The cluster size. + * + * @return the clusterSize value. + */ + public Integer clusterSize() { + return this.clusterSize; + } + + /** + * Set the clusterSize property: The cluster size. + * + * @param clusterSize the clusterSize value to set. + * @return the CommonClusterProperties object itself. + */ + public CommonClusterProperties withClusterSize(Integer clusterSize) { + this.clusterSize = clusterSize; + return this; + } + + /** + * Get the clusterId property: The identity. + * + * @return the clusterId value. + */ + public Integer clusterId() { + return this.clusterId; + } + + /** + * Get the hosts property: The hosts. + * + * @return the hosts value. + */ + public List hosts() { + return this.hosts; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java new file mode 100644 index 000000000000..f9ded914de52 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastore.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; + +/** An immutable client-side representation of Datastore. */ +public interface Datastore { + /** + * 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 provisioningState property: The state of the datastore provisioning. + * + * @return the provisioningState value. + */ + DatastoreProvisioningState provisioningState(); + + /** + * Gets the netAppVolume property: An Azure NetApp Files volume. + * + * @return the netAppVolume value. + */ + NetAppVolume netAppVolume(); + + /** + * Gets the diskPoolVolume property: An iSCSI volume. + * + * @return the diskPoolVolume value. + */ + DiskPoolVolume diskPoolVolume(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.DatastoreInner object. + * + * @return the inner object. + */ + DatastoreInner innerModel(); + + /** The entirety of the Datastore definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Datastore definition stages. */ + interface DefinitionStages { + /** The first stage of the Datastore definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Datastore definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName, clusterName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String privateCloudName, String clusterName); + } + /** + * The stage of the Datastore 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.WithNetAppVolume, DefinitionStages.WithDiskPoolVolume { + /** + * Executes the create request. + * + * @return the created resource. + */ + Datastore create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Datastore create(Context context); + } + /** The stage of the Datastore definition allowing to specify netAppVolume. */ + interface WithNetAppVolume { + /** + * Specifies the netAppVolume property: An Azure NetApp Files volume. + * + * @param netAppVolume An Azure NetApp Files volume. + * @return the next definition stage. + */ + WithCreate withNetAppVolume(NetAppVolume netAppVolume); + } + /** The stage of the Datastore definition allowing to specify diskPoolVolume. */ + interface WithDiskPoolVolume { + /** + * Specifies the diskPoolVolume property: An iSCSI volume. + * + * @param diskPoolVolume An iSCSI volume. + * @return the next definition stage. + */ + WithCreate withDiskPoolVolume(DiskPoolVolume diskPoolVolume); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Datastore refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Datastore refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java new file mode 100644 index 000000000000..0e7688f6f27d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.DatastoreInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of datastores. */ +@Immutable +public final class DatastoreList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DatastoreList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java new file mode 100644 index 000000000000..6fd1ecf0339c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DatastoreProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DatastoreProvisioningState. */ +public final class DatastoreProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Deleting for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for DatastoreProvisioningState. */ + public static final DatastoreProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a DatastoreProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DatastoreProvisioningState. + */ + @JsonCreator + public static DatastoreProvisioningState fromString(String name) { + return fromString(name, DatastoreProvisioningState.class); + } + + /** @return known DatastoreProvisioningState values. */ + public static Collection values() { + return values(DatastoreProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java new file mode 100644 index 000000000000..e6e441821fd5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Datastores.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 Datastores. */ +public interface Datastores { + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, String clusterName); + + /** + * List cloud datastores in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of datastores. + */ + PagedIterable list( + String resourceGroupName, String privateCloudName, String clusterName, Context context); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore in a private cloud cluster. + */ + Datastore get(String resourceGroupName, String privateCloudName, String clusterName, String datastoreName); + + /** + * Get a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 datastore in a private cloud cluster. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, String clusterName, String datastoreName); + + /** + * Delete a datastore in a private cloud cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param clusterName Name of the cluster in the private cloud. + * @param datastoreName Name of the datastore in the private cloud cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateCloudName, String clusterName, String datastoreName, Context context); + + /** + * Get a datastore in a private cloud cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + Datastore getById(String id); + + /** + * Get a datastore in a private cloud cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a datastore in a private cloud cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a datastore in a private cloud cluster. + * + * @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); + + /** + * Delete a datastore in a private cloud cluster. + * + * @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 Datastore resource. + * + * @param name resource name. + * @return the first stage of the new Datastore definition. + */ + Datastore.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java new file mode 100644 index 000000000000..44f6ed7eaa55 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DhcpTypeEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DhcpTypeEnum. */ +public final class DhcpTypeEnum extends ExpandableStringEnum { + /** Static value SERVER, RELAY for DhcpTypeEnum. */ + public static final DhcpTypeEnum SERVER_RELAY = fromString("SERVER, RELAY"); + + /** + * Creates or finds a DhcpTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding DhcpTypeEnum. + */ + @JsonCreator + public static DhcpTypeEnum fromString(String name) { + return fromString(name, DhcpTypeEnum.class); + } + + /** @return known DhcpTypeEnum values. */ + public static Collection values() { + return values(DhcpTypeEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.java new file mode 100644 index 000000000000..b636f269b0a8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DiskPoolVolume.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An iSCSI volume from Microsoft.StoragePool provider. */ +@Fluent +public final class DiskPoolVolume { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolVolume.class); + + /* + * iSCSI provider target IP address list + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /* + * Name of the LUN to be used + */ + @JsonProperty(value = "lunName") + private String lunName; + + /** + * Get the endpoints property: iSCSI provider target IP address list. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: iSCSI provider target IP address list. + * + * @param endpoints the endpoints value to set. + * @return the DiskPoolVolume object itself. + */ + public DiskPoolVolume withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the lunName property: Name of the LUN to be used. + * + * @return the lunName value. + */ + public String lunName() { + return this.lunName; + } + + /** + * Set the lunName property: Name of the LUN to be used. + * + * @param lunName the lunName value to set. + * @return the DiskPoolVolume object itself. + */ + public DiskPoolVolume withLunName(String lunName) { + this.lunName = lunName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java new file mode 100644 index 000000000000..c6563e416b17 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceLogLevelEnum.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DnsServiceLogLevelEnum. */ +public final class DnsServiceLogLevelEnum extends ExpandableStringEnum { + /** Static value DEBUG for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum DEBUG = fromString("DEBUG"); + + /** Static value INFO for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum INFO = fromString("INFO"); + + /** Static value WARNING for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum WARNING = fromString("WARNING"); + + /** Static value ERROR for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum ERROR = fromString("ERROR"); + + /** Static value FATAL for DnsServiceLogLevelEnum. */ + public static final DnsServiceLogLevelEnum FATAL = fromString("FATAL"); + + /** + * Creates or finds a DnsServiceLogLevelEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsServiceLogLevelEnum. + */ + @JsonCreator + public static DnsServiceLogLevelEnum fromString(String name) { + return fromString(name, DnsServiceLogLevelEnum.class); + } + + /** @return known DnsServiceLogLevelEnum values. */ + public static Collection values() { + return values(DnsServiceLogLevelEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.java new file mode 100644 index 000000000000..6da13ca6f03d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/DnsServiceStatusEnum.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DnsServiceStatusEnum. */ +public final class DnsServiceStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS for DnsServiceStatusEnum. */ + public static final DnsServiceStatusEnum SUCCESS = fromString("SUCCESS"); + + /** Static value FAILURE for DnsServiceStatusEnum. */ + public static final DnsServiceStatusEnum FAILURE = fromString("FAILURE"); + + /** + * Creates or finds a DnsServiceStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding DnsServiceStatusEnum. + */ + @JsonCreator + public static DnsServiceStatusEnum fromString(String name) { + return fromString(name, DnsServiceStatusEnum.class); + } + + /** @return known DnsServiceStatusEnum values. */ + public static Collection values() { + return values(DnsServiceStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java new file mode 100644 index 000000000000..ed4a4dd08b0b --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Endpoints.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Endpoint addresses. */ +@Immutable +public final class Endpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Endpoints.class); + + /* + * Endpoint for the NSX-T Data Center manager + */ + @JsonProperty(value = "nsxtManager", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtManager; + + /* + * Endpoint for Virtual Center Server Appliance + */ + @JsonProperty(value = "vcsa", access = JsonProperty.Access.WRITE_ONLY) + private String vcsa; + + /* + * Endpoint for the HCX Cloud Manager + */ + @JsonProperty(value = "hcxCloudManager", access = JsonProperty.Access.WRITE_ONLY) + private String hcxCloudManager; + + /** + * Get the nsxtManager property: Endpoint for the NSX-T Data Center manager. + * + * @return the nsxtManager value. + */ + public String nsxtManager() { + return this.nsxtManager; + } + + /** + * Get the vcsa property: Endpoint for Virtual Center Server Appliance. + * + * @return the vcsa value. + */ + public String vcsa() { + return this.vcsa; + } + + /** + * Get the hcxCloudManager property: Endpoint for the HCX Cloud Manager. + * + * @return the hcxCloudManager value. + */ + public String hcxCloudManager() { + return this.hcxCloudManager; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java new file mode 100644 index 000000000000..0a864a21dbc0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorization.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; + +/** An immutable client-side representation of ExpressRouteAuthorization. */ +public interface ExpressRouteAuthorization { + /** + * 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 provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. + * + * @return the provisioningState value. + */ + ExpressRouteAuthorizationProvisioningState provisioningState(); + + /** + * Gets the expressRouteAuthorizationId property: The ID of the ExpressRoute Circuit Authorization. + * + * @return the expressRouteAuthorizationId value. + */ + String expressRouteAuthorizationId(); + + /** + * Gets the expressRouteAuthorizationKey property: The key of the ExpressRoute Circuit Authorization. + * + * @return the expressRouteAuthorizationKey value. + */ + String expressRouteAuthorizationKey(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner object. + * + * @return the inner object. + */ + ExpressRouteAuthorizationInner innerModel(); + + /** The entirety of the ExpressRouteAuthorization definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExpressRouteAuthorization definition stages. */ + interface DefinitionStages { + /** The first stage of the ExpressRouteAuthorization definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExpressRouteAuthorization definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the ExpressRouteAuthorization 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRouteAuthorization create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRouteAuthorization create(Context context); + } + } + /** + * Begins update for the ExpressRouteAuthorization resource. + * + * @return the stage of resource update. + */ + ExpressRouteAuthorization.Update update(); + + /** The template for ExpressRouteAuthorization update. */ + interface Update { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRouteAuthorization apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRouteAuthorization apply(Context context); + } + /** The ExpressRouteAuthorization update stages. */ + interface UpdateStages { + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRouteAuthorization refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRouteAuthorization refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java new file mode 100644 index 000000000000..b2ded183dd02 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.ExpressRouteAuthorizationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of ExpressRoute Circuit Authorizations. */ +@Immutable +public final class ExpressRouteAuthorizationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExpressRouteAuthorizationList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.java new file mode 100644 index 000000000000..9417bb55c2e7 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ExpressRouteAuthorizationProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExpressRouteAuthorizationProvisioningState. */ +public final class ExpressRouteAuthorizationProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for ExpressRouteAuthorizationProvisioningState. */ + public static final ExpressRouteAuthorizationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ExpressRouteAuthorizationProvisioningState. */ + public static final ExpressRouteAuthorizationProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for ExpressRouteAuthorizationProvisioningState. */ + public static final ExpressRouteAuthorizationProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a ExpressRouteAuthorizationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteAuthorizationProvisioningState. + */ + @JsonCreator + public static ExpressRouteAuthorizationProvisioningState fromString(String name) { + return fromString(name, ExpressRouteAuthorizationProvisioningState.class); + } + + /** @return known ExpressRouteAuthorizationProvisioningState values. */ + public static Collection values() { + return values(ExpressRouteAuthorizationProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java new file mode 100644 index 000000000000..6f37c17da71a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnection.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; + +/** An immutable client-side representation of GlobalReachConnection. */ +public interface GlobalReachConnection { + /** + * 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 provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning. + * + * @return the provisioningState value. + */ + GlobalReachConnectionProvisioningState provisioningState(); + + /** + * Gets the addressPrefix property: The network used for global reach carved out from the original network block + * provided for the private cloud. + * + * @return the addressPrefix value. + */ + String addressPrefix(); + + /** + * Gets the authorizationKey property: Authorization key from the peer express route used for the global reach + * connection. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the circuitConnectionStatus property: The connection status of the global reach connection. + * + * @return the circuitConnectionStatus value. + */ + GlobalReachConnectionStatus circuitConnectionStatus(); + + /** + * Gets the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global + * reach connection. + * + * @return the peerExpressRouteCircuit value. + */ + String peerExpressRouteCircuit(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner object. + * + * @return the inner object. + */ + GlobalReachConnectionInner innerModel(); + + /** The entirety of the GlobalReachConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The GlobalReachConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the GlobalReachConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GlobalReachConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the GlobalReachConnection 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.WithAuthorizationKey, DefinitionStages.WithPeerExpressRouteCircuit { + /** + * Executes the create request. + * + * @return the created resource. + */ + GlobalReachConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GlobalReachConnection create(Context context); + } + /** The stage of the GlobalReachConnection definition allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: Authorization key from the peer express route used for the + * global reach connection. + * + * @param authorizationKey Authorization key from the peer express route used for the global reach + * connection. + * @return the next definition stage. + */ + WithCreate withAuthorizationKey(String authorizationKey); + } + /** The stage of the GlobalReachConnection definition allowing to specify peerExpressRouteCircuit. */ + interface WithPeerExpressRouteCircuit { + /** + * Specifies the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in + * the global reach connection. + * + * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * @return the next definition stage. + */ + WithCreate withPeerExpressRouteCircuit(String peerExpressRouteCircuit); + } + } + /** + * Begins update for the GlobalReachConnection resource. + * + * @return the stage of resource update. + */ + GlobalReachConnection.Update update(); + + /** The template for GlobalReachConnection update. */ + interface Update extends UpdateStages.WithAuthorizationKey, UpdateStages.WithPeerExpressRouteCircuit { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GlobalReachConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GlobalReachConnection apply(Context context); + } + /** The GlobalReachConnection update stages. */ + interface UpdateStages { + /** The stage of the GlobalReachConnection update allowing to specify authorizationKey. */ + interface WithAuthorizationKey { + /** + * Specifies the authorizationKey property: Authorization key from the peer express route used for the + * global reach connection. + * + * @param authorizationKey Authorization key from the peer express route used for the global reach + * connection. + * @return the next definition stage. + */ + Update withAuthorizationKey(String authorizationKey); + } + /** The stage of the GlobalReachConnection update allowing to specify peerExpressRouteCircuit. */ + interface WithPeerExpressRouteCircuit { + /** + * Specifies the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in + * the global reach connection. + * + * @param peerExpressRouteCircuit Identifier of the ExpressRoute Circuit to peer with in the global reach + * connection. + * @return the next definition stage. + */ + Update withPeerExpressRouteCircuit(String peerExpressRouteCircuit); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GlobalReachConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GlobalReachConnection refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java new file mode 100644 index 000000000000..0fe961e0c62f --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.GlobalReachConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of global reach connections. */ +@Immutable +public final class GlobalReachConnectionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalReachConnectionList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.java new file mode 100644 index 000000000000..46e331c555ab --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GlobalReachConnectionProvisioningState. */ +public final class GlobalReachConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for GlobalReachConnectionProvisioningState. */ + public static final GlobalReachConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for GlobalReachConnectionProvisioningState. */ + public static final GlobalReachConnectionProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for GlobalReachConnectionProvisioningState. */ + public static final GlobalReachConnectionProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a GlobalReachConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlobalReachConnectionProvisioningState. + */ + @JsonCreator + public static GlobalReachConnectionProvisioningState fromString(String name) { + return fromString(name, GlobalReachConnectionProvisioningState.class); + } + + /** @return known GlobalReachConnectionProvisioningState values. */ + public static Collection values() { + return values(GlobalReachConnectionProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java new file mode 100644 index 000000000000..d3c4ca0ffe32 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnectionStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GlobalReachConnectionStatus. */ +public final class GlobalReachConnectionStatus extends ExpandableStringEnum { + /** Static value Connected for GlobalReachConnectionStatus. */ + public static final GlobalReachConnectionStatus CONNECTED = fromString("Connected"); + + /** Static value Connecting for GlobalReachConnectionStatus. */ + public static final GlobalReachConnectionStatus CONNECTING = fromString("Connecting"); + + /** Static value Disconnected for GlobalReachConnectionStatus. */ + public static final GlobalReachConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a GlobalReachConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlobalReachConnectionStatus. + */ + @JsonCreator + public static GlobalReachConnectionStatus fromString(String name) { + return fromString(name, GlobalReachConnectionStatus.class); + } + + /** @return known GlobalReachConnectionStatus values. */ + public static Collection values() { + return values(GlobalReachConnectionStatus.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java new file mode 100644 index 000000000000..861a4a862cd3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/GlobalReachConnections.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 GlobalReachConnections. */ +public interface GlobalReachConnections { + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List global reach connections in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of global reach connections. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + GlobalReachConnection get(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName); + + /** + * Delete a global reach connection in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param globalReachConnectionName Name of the global reach connection in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String globalReachConnectionName, Context context); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + GlobalReachConnection getById(String id); + + /** + * Get a global reach connection by name in a private cloud. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a global reach connection by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a global reach connection in a private cloud. + * + * @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); + + /** + * Delete a global reach connection in a private cloud. + * + * @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 GlobalReachConnection resource. + * + * @param name resource name. + * @return the first stage of the new GlobalReachConnection definition. + */ + GlobalReachConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.java new file mode 100644 index 000000000000..4271101ddc91 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSite.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.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; + +/** An immutable client-side representation of HcxEnterpriseSite. */ +public interface HcxEnterpriseSite { + /** + * 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 activationKey property: The activation key. + * + * @return the activationKey value. + */ + String activationKey(); + + /** + * Gets the status property: The status of the HCX Enterprise Site. + * + * @return the status value. + */ + HcxEnterpriseSiteStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner object. + * + * @return the inner object. + */ + HcxEnterpriseSiteInner innerModel(); + + /** The entirety of the HcxEnterpriseSite definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The HcxEnterpriseSite definition stages. */ + interface DefinitionStages { + /** The first stage of the HcxEnterpriseSite definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the HcxEnterpriseSite definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName The name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the HcxEnterpriseSite 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + HcxEnterpriseSite create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + HcxEnterpriseSite create(Context context); + } + } + /** + * Begins update for the HcxEnterpriseSite resource. + * + * @return the stage of resource update. + */ + HcxEnterpriseSite.Update update(); + + /** The template for HcxEnterpriseSite update. */ + interface Update { + /** + * Executes the update request. + * + * @return the updated resource. + */ + HcxEnterpriseSite apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + HcxEnterpriseSite apply(Context context); + } + /** The HcxEnterpriseSite update stages. */ + interface UpdateStages { + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + HcxEnterpriseSite refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + HcxEnterpriseSite refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java new file mode 100644 index 000000000000..bd7b127715fc --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.HcxEnterpriseSiteInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of HCX Enterprise Sites. */ +@Immutable +public final class HcxEnterpriseSiteList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HcxEnterpriseSiteList.class); + + /* + * The items on a page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on a page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.java new file mode 100644 index 000000000000..75ed1e3c7cd7 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSiteStatus.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for HcxEnterpriseSiteStatus. */ +public final class HcxEnterpriseSiteStatus extends ExpandableStringEnum { + /** Static value Available for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus AVAILABLE = fromString("Available"); + + /** Static value Consumed for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus CONSUMED = fromString("Consumed"); + + /** Static value Deactivated for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus DEACTIVATED = fromString("Deactivated"); + + /** Static value Deleted for HcxEnterpriseSiteStatus. */ + public static final HcxEnterpriseSiteStatus DELETED = fromString("Deleted"); + + /** + * Creates or finds a HcxEnterpriseSiteStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HcxEnterpriseSiteStatus. + */ + @JsonCreator + public static HcxEnterpriseSiteStatus fromString(String name) { + return fromString(name, HcxEnterpriseSiteStatus.class); + } + + /** @return known HcxEnterpriseSiteStatus values. */ + public static Collection values() { + return values(HcxEnterpriseSiteStatus.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java new file mode 100644 index 000000000000..e5a9e518e951 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/HcxEnterpriseSites.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 HcxEnterpriseSites. */ +public interface HcxEnterpriseSites { + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + PagedIterable list(String resourceGroupName, String privateCloudName); + + /** + * List HCX Enterprise Sites in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of HCX Enterprise Sites. + */ + PagedIterable list(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + HcxEnterpriseSite get(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName); + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an HCX Enterprise Site by name in a private cloud. + */ + Response getWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context); + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName); + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param hcxEnterpriseSiteName Name of the HCX Enterprise Site in the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String privateCloudName, String hcxEnterpriseSiteName, Context context); + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @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 an HCX Enterprise Site by name in a private cloud. + */ + HcxEnterpriseSite getById(String id); + + /** + * Get an HCX Enterprise Site by name in a private cloud. + * + * @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 an HCX Enterprise Site by name in a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @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); + + /** + * Delete an HCX Enterprise Site in a private cloud. + * + * @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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new HcxEnterpriseSite resource. + * + * @param name resource name. + * @return the first stage of the new HcxEnterpriseSite definition. + */ + HcxEnterpriseSite.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java new file mode 100644 index 000000000000..254b0ea80077 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** vCenter Single Sign On Identity Source. */ +@Fluent +public final class IdentitySource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentitySource.class); + + /* + * The name of the identity source + */ + @JsonProperty(value = "name") + private String name; + + /* + * The domain's NetBIOS name + */ + @JsonProperty(value = "alias") + private String alias; + + /* + * The domain's dns name + */ + @JsonProperty(value = "domain") + private String domain; + + /* + * The base distinguished name for users + */ + @JsonProperty(value = "baseUserDN") + private String baseUserDN; + + /* + * The base distinguished name for groups + */ + @JsonProperty(value = "baseGroupDN") + private String baseGroupDN; + + /* + * Primary server URL + */ + @JsonProperty(value = "primaryServer") + private String primaryServer; + + /* + * Secondary server URL + */ + @JsonProperty(value = "secondaryServer") + private String secondaryServer; + + /* + * Protect LDAP communication using SSL certificate (LDAPS) + */ + @JsonProperty(value = "ssl") + private SslEnum ssl; + + /* + * The ID of an Active Directory user with a minimum of read-only access to + * Base DN for users and group + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password of the Active Directory user with a minimum of read-only + * access to Base DN for users and groups. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the name property: The name of the identity source. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the identity source. + * + * @param name the name value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the alias property: The domain's NetBIOS name. + * + * @return the alias value. + */ + public String alias() { + return this.alias; + } + + /** + * Set the alias property: The domain's NetBIOS name. + * + * @param alias the alias value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the domain property: The domain's dns name. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The domain's dns name. + * + * @param domain the domain value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the baseUserDN property: The base distinguished name for users. + * + * @return the baseUserDN value. + */ + public String baseUserDN() { + return this.baseUserDN; + } + + /** + * Set the baseUserDN property: The base distinguished name for users. + * + * @param baseUserDN the baseUserDN value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withBaseUserDN(String baseUserDN) { + this.baseUserDN = baseUserDN; + return this; + } + + /** + * Get the baseGroupDN property: The base distinguished name for groups. + * + * @return the baseGroupDN value. + */ + public String baseGroupDN() { + return this.baseGroupDN; + } + + /** + * Set the baseGroupDN property: The base distinguished name for groups. + * + * @param baseGroupDN the baseGroupDN value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withBaseGroupDN(String baseGroupDN) { + this.baseGroupDN = baseGroupDN; + return this; + } + + /** + * Get the primaryServer property: Primary server URL. + * + * @return the primaryServer value. + */ + public String primaryServer() { + return this.primaryServer; + } + + /** + * Set the primaryServer property: Primary server URL. + * + * @param primaryServer the primaryServer value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withPrimaryServer(String primaryServer) { + this.primaryServer = primaryServer; + return this; + } + + /** + * Get the secondaryServer property: Secondary server URL. + * + * @return the secondaryServer value. + */ + public String secondaryServer() { + return this.secondaryServer; + } + + /** + * Set the secondaryServer property: Secondary server URL. + * + * @param secondaryServer the secondaryServer value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withSecondaryServer(String secondaryServer) { + this.secondaryServer = secondaryServer; + return this; + } + + /** + * Get the ssl property: Protect LDAP communication using SSL certificate (LDAPS). + * + * @return the ssl value. + */ + public SslEnum ssl() { + return this.ssl; + } + + /** + * Set the ssl property: Protect LDAP communication using SSL certificate (LDAPS). + * + * @param ssl the ssl value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withSsl(SslEnum ssl) { + this.ssl = ssl; + return this; + } + + /** + * Get the username property: The ID of an Active Directory user with a minimum of read-only access to Base DN for + * users and group. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The ID of an Active Directory user with a minimum of read-only access to Base DN for + * users and group. + * + * @param username the username value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the Active Directory user with a minimum of read-only access to Base + * DN for users and groups. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the Active Directory user with a minimum of read-only access to Base + * DN for users and groups. + * + * @param password the password value to set. + * @return the IdentitySource object itself. + */ + public IdentitySource withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.java new file mode 100644 index 000000000000..96afefae99e9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/InternetEnum.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InternetEnum. */ +public final class InternetEnum extends ExpandableStringEnum { + /** Static value Enabled for InternetEnum. */ + public static final InternetEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for InternetEnum. */ + public static final InternetEnum DISABLED = fromString("Disabled"); + + /** + * Creates or finds a InternetEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding InternetEnum. + */ + @JsonCreator + public static InternetEnum fromString(String name) { + return fromString(name, InternetEnum.class); + } + + /** @return known InternetEnum values. */ + public static Collection values() { + return values(InternetEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.java new file mode 100644 index 000000000000..06887a5f4675 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Locations.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.avs.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + Trial checkTrialAvailability(String location); + + /** + * Return trial status for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription trial availability. + */ + Response checkTrialAvailabilityWithResponse(String location, Context context); + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + Quota checkQuotaAvailability(String location); + + /** + * Return quota for subscription by region. + * + * @param location Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quotas. + */ + Response checkQuotaAvailabilityWithResponse(String location, Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/LogSpecification.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/LogSpecification.java new file mode 100644 index 000000000000..06a7966a15d3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Log for Azure Monitoring. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * Name of the log + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the log + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of the log + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of the log. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of the log. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java new file mode 100644 index 000000000000..eeba5663db84 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ManagementCluster.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The properties of a management cluster. */ +@Immutable +public final class ManagementCluster extends CommonClusterProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementCluster.class); + + /** {@inheritDoc} */ + @Override + public ManagementCluster withClusterSize(Integer clusterSize) { + super.withClusterSize(clusterSize); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricDimension.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricDimension.java new file mode 100644 index 000000000000..45f5278ee505 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricDimension.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Dimension of metrics. */ +@Fluent +public final class MetricDimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); + + /* + * Name of the dimension + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the dimension + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Name of the dimension as it appears in MDM + */ + @JsonProperty(value = "internalName") + private String internalName; + + /* + * A boolean flag indicating whether this dimension should be included for + * the shoebox export scenario + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the dimension. + * + * @param name the name value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: Name of the dimension as it appears in MDM. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: Name of the dimension as it appears in MDM. + * + * @param internalName the internalName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: A boolean flag indicating whether this dimension should be included for + * the shoebox export scenario. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: A boolean flag indicating whether this dimension should be included for + * the shoebox export scenario. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricSpecification.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricSpecification.java new file mode 100644 index 000000000000..03b1c521c1aa --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/MetricSpecification.java @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifications of the Metrics for Azure Monitoring. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of the metric + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the metric + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localized friendly description of the metric + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit that makes sense for the metric + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Supported aggregation types + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * Supported time grain types + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Dimensions of the metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Whether or not the service is using regional MDM accounts. + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private String enableRegionalMdmAccount; + + /* + * The name of the MDM account. + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /* + * The name of the MDM namespace. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit that makes sense for the metric. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: Supported aggregation types. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: Supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: Supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the dimensions property: Dimensions of the metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of the metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the enableRegionalMdmAccount property: Whether or not the service is using regional MDM accounts. + * + * @return the enableRegionalMdmAccount value. + */ + public String enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set the enableRegionalMdmAccount property: Whether or not the service is using regional MDM accounts. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withEnableRegionalMdmAccount(String enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the sourceMdmAccount property: The name of the MDM account. + * + * @return the sourceMdmAccount value. + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the sourceMdmAccount property: The name of the MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the sourceMdmNamespace property: The name of the MDM namespace. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: The name of the MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java new file mode 100644 index 000000000000..4036181c1707 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/NetAppVolume.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An Azure NetApp Files volume from Microsoft.NetApp provider. */ +@Fluent +public final class NetAppVolume { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetAppVolume.class); + + /* + * IP address of the NFS provider + */ + @JsonProperty(value = "nfsProviderIp") + private String nfsProviderIp; + + /* + * File path through which the NFS volume is exposed by the provider + */ + @JsonProperty(value = "nfsFilePath") + private String nfsFilePath; + + /** + * Get the nfsProviderIp property: IP address of the NFS provider. + * + * @return the nfsProviderIp value. + */ + public String nfsProviderIp() { + return this.nfsProviderIp; + } + + /** + * Set the nfsProviderIp property: IP address of the NFS provider. + * + * @param nfsProviderIp the nfsProviderIp value to set. + * @return the NetAppVolume object itself. + */ + public NetAppVolume withNfsProviderIp(String nfsProviderIp) { + this.nfsProviderIp = nfsProviderIp; + return this; + } + + /** + * Get the nfsFilePath property: File path through which the NFS volume is exposed by the provider. + * + * @return the nfsFilePath value. + */ + public String nfsFilePath() { + return this.nfsFilePath; + } + + /** + * Set the nfsFilePath property: File path through which the NFS volume is exposed by the provider. + * + * @param nfsFilePath the nfsFilePath value to set. + * @return the NetAppVolume object itself. + */ + public NetAppVolume withNfsFilePath(String nfsFilePath) { + this.nfsFilePath = nfsFilePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.java new file mode 100644 index 000000000000..6afa83bc4ba5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operation.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.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Name of the operation being performed on this object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Contains the localized display information for this operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the isDataAction property: Gets or sets a value indicating whether the operation is a data action or not. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + OperationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.java new file mode 100644 index 000000000000..69d36d2f0a70 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationDisplay.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.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the localized display information for this operation. */ +@Immutable +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Localized friendly form of the resource provider name + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Localized friendly form of the resource type related to this operation + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get the provider property: Localized friendly form of the resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Localized friendly form of the resource type related to this operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationList.java new file mode 100644 index 000000000000..dd66d3048feb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pageable list of operations. */ +@Immutable +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * List of operations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationProperties.java new file mode 100644 index 000000000000..d673d4f092ea --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/OperationProperties.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extra Operation properties. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * Service specifications of the operation + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Service specifications of the operation. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operations.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operations.java new file mode 100644 index 000000000000..a1b3a4e23676 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + PagedIterable list(); + + /** + * Lists all of the available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pageable list of operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java new file mode 100644 index 000000000000..d75a58eda10e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringDirectionEnum.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PortMirroringDirectionEnum. */ +public final class PortMirroringDirectionEnum extends ExpandableStringEnum { + /** Static value INGRESS, EGRESS, BIDIRECTIONAL for PortMirroringDirectionEnum. */ + public static final PortMirroringDirectionEnum INGRESS_EGRESS_BIDIRECTIONAL = + fromString("INGRESS, EGRESS, BIDIRECTIONAL"); + + /** + * Creates or finds a PortMirroringDirectionEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding PortMirroringDirectionEnum. + */ + @JsonCreator + public static PortMirroringDirectionEnum fromString(String name) { + return fromString(name, PortMirroringDirectionEnum.class); + } + + /** @return known PortMirroringDirectionEnum values. */ + public static Collection values() { + return values(PortMirroringDirectionEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java new file mode 100644 index 000000000000..80db3b35d43d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PortMirroringStatusEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PortMirroringStatusEnum. */ +public final class PortMirroringStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS, FAILURE for PortMirroringStatusEnum. */ + public static final PortMirroringStatusEnum SUCCESS_FAILURE = fromString("SUCCESS, FAILURE"); + + /** + * Creates or finds a PortMirroringStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding PortMirroringStatusEnum. + */ + @JsonCreator + public static PortMirroringStatusEnum fromString(String name) { + return fromString(name, PortMirroringStatusEnum.class); + } + + /** @return known PortMirroringStatusEnum values. */ + public static Collection values() { + return values(PortMirroringStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java new file mode 100644 index 000000000000..24295ee91f5d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloud.java @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PrivateCloud. */ +public interface PrivateCloud { + /** + * 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 sku property: The private cloud SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the managementCluster property: The default cluster used for management. + * + * @return the managementCluster value. + */ + ManagementCluster managementCluster(); + + /** + * Gets the internet property: Connectivity to internet is enabled or disabled. + * + * @return the internet value. + */ + InternetEnum internet(); + + /** + * Gets the identitySources property: vCenter Single Sign On Identity Sources. + * + * @return the identitySources value. + */ + List identitySources(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + PrivateCloudProvisioningState provisioningState(); + + /** + * Gets the circuit property: An ExpressRoute Circuit. + * + * @return the circuit value. + */ + Circuit circuit(); + + /** + * Gets the endpoints property: The endpoints. + * + * @return the endpoints value. + */ + Endpoints endpoints(); + + /** + * Gets the networkBlock property: The block of addresses should be unique across VNet in your subscription as well + * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X + * is between 0 and 22. + * + * @return the networkBlock value. + */ + String networkBlock(); + + /** + * Gets the managementNetwork property: Network used to access vCenter Server and NSX-T Manager. + * + * @return the managementNetwork value. + */ + String managementNetwork(); + + /** + * Gets the provisioningNetwork property: Used for virtual machine cold migration, cloning, and snapshot migration. + * + * @return the provisioningNetwork value. + */ + String provisioningNetwork(); + + /** + * Gets the vmotionNetwork property: Used for live migration of virtual machines. + * + * @return the vmotionNetwork value. + */ + String vmotionNetwork(); + + /** + * Gets the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. + * + * @return the vcenterPassword value. + */ + String vcenterPassword(); + + /** + * Gets the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. + * + * @return the nsxtPassword value. + */ + String nsxtPassword(); + + /** + * Gets the vcenterCertificateThumbprint property: Thumbprint of the vCenter Server SSL certificate. + * + * @return the vcenterCertificateThumbprint value. + */ + String vcenterCertificateThumbprint(); + + /** + * Gets the nsxtCertificateThumbprint property: Thumbprint of the NSX-T Manager SSL certificate. + * + * @return the nsxtCertificateThumbprint value. + */ + String nsxtCertificateThumbprint(); + + /** + * 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 inner com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner object. + * + * @return the inner object. + */ + PrivateCloudInner innerModel(); + + /** The entirety of the PrivateCloud definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The PrivateCloud definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateCloud definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateCloud 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 PrivateCloud 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. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the PrivateCloud definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The private cloud SKU. + * + * @param sku The private cloud SKU. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the PrivateCloud 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.WithManagementCluster, + DefinitionStages.WithInternet, + DefinitionStages.WithIdentitySources, + DefinitionStages.WithCircuit, + DefinitionStages.WithNetworkBlock, + DefinitionStages.WithVcenterPassword, + DefinitionStages.WithNsxtPassword { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateCloud create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateCloud create(Context context); + } + /** The stage of the PrivateCloud 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 PrivateCloud definition allowing to specify managementCluster. */ + interface WithManagementCluster { + /** + * Specifies the managementCluster property: The default cluster used for management. + * + * @param managementCluster The default cluster used for management. + * @return the next definition stage. + */ + WithCreate withManagementCluster(ManagementCluster managementCluster); + } + /** The stage of the PrivateCloud definition allowing to specify internet. */ + interface WithInternet { + /** + * Specifies the internet property: Connectivity to internet is enabled or disabled. + * + * @param internet Connectivity to internet is enabled or disabled. + * @return the next definition stage. + */ + WithCreate withInternet(InternetEnum internet); + } + /** The stage of the PrivateCloud definition allowing to specify identitySources. */ + interface WithIdentitySources { + /** + * Specifies the identitySources property: vCenter Single Sign On Identity Sources. + * + * @param identitySources vCenter Single Sign On Identity Sources. + * @return the next definition stage. + */ + WithCreate withIdentitySources(List identitySources); + } + /** The stage of the PrivateCloud definition allowing to specify circuit. */ + interface WithCircuit { + /** + * Specifies the circuit property: An ExpressRoute Circuit. + * + * @param circuit An ExpressRoute Circuit. + * @return the next definition stage. + */ + WithCreate withCircuit(Circuit circuit); + } + /** The stage of the PrivateCloud definition allowing to specify networkBlock. */ + interface WithNetworkBlock { + /** + * Specifies the networkBlock property: The block of addresses should be unique across VNet in your + * subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D + * are between 0 and 255, and X is between 0 and 22. + * + * @param networkBlock The block of addresses should be unique across VNet in your subscription as well as + * on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and + * 255, and X is between 0 and 22. + * @return the next definition stage. + */ + WithCreate withNetworkBlock(String networkBlock); + } + /** The stage of the PrivateCloud definition allowing to specify vcenterPassword. */ + interface WithVcenterPassword { + /** + * Specifies the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud + * is created. + * + * @param vcenterPassword Optionally, set the vCenter admin password when the private cloud is created. + * @return the next definition stage. + */ + WithCreate withVcenterPassword(String vcenterPassword); + } + /** The stage of the PrivateCloud definition allowing to specify nsxtPassword. */ + interface WithNsxtPassword { + /** + * Specifies the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is + * created. + * + * @param nsxtPassword Optionally, set the NSX-T Manager password when the private cloud is created. + * @return the next definition stage. + */ + WithCreate withNsxtPassword(String nsxtPassword); + } + } + /** + * Begins update for the PrivateCloud resource. + * + * @return the stage of resource update. + */ + PrivateCloud.Update update(); + + /** The template for PrivateCloud update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithManagementCluster, + UpdateStages.WithInternet, + UpdateStages.WithIdentitySources { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateCloud apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateCloud apply(Context context); + } + /** The PrivateCloud update stages. */ + interface UpdateStages { + /** The stage of the PrivateCloud update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PrivateCloud update allowing to specify managementCluster. */ + interface WithManagementCluster { + /** + * Specifies the managementCluster property: The default cluster used for management. + * + * @param managementCluster The default cluster used for management. + * @return the next definition stage. + */ + Update withManagementCluster(ManagementCluster managementCluster); + } + /** The stage of the PrivateCloud update allowing to specify internet. */ + interface WithInternet { + /** + * Specifies the internet property: Connectivity to internet is enabled or disabled. + * + * @param internet Connectivity to internet is enabled or disabled. + * @return the next definition stage. + */ + Update withInternet(InternetEnum internet); + } + /** The stage of the PrivateCloud update allowing to specify identitySources. */ + interface WithIdentitySources { + /** + * Specifies the identitySources property: vCenter Single Sign On Identity Sources. + * + * @param identitySources vCenter Single Sign On Identity Sources. + * @return the next definition stage. + */ + Update withIdentitySources(List identitySources); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateCloud refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateCloud refresh(Context context); + + /** + * Rotate the vCenter password. + * + * @throws com.azure.core.management.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 rotateVcenterPassword(); + + /** + * Rotate the vCenter password. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateVcenterPassword(Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @throws com.azure.core.management.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 rotateNsxtPassword(); + + /** + * Rotate the NSX-T Manager password. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateNsxtPassword(Context context); + + /** + * List the admin credentials for the private cloud. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + AdminCredentials listAdminCredentials(); + + /** + * List the admin credentials for the private cloud. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + Response listAdminCredentialsWithResponse(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java new file mode 100644 index 000000000000..83854d31dd90 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A paged list of private clouds. */ +@Immutable +public final class PrivateCloudList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java new file mode 100644 index 000000000000..7b7cba390b7e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProperties.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a private cloud resource. */ +@Fluent +public final class PrivateCloudProperties extends PrivateCloudUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudProperties.class); + + /* + * The provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateCloudProvisioningState provisioningState; + + /* + * An ExpressRoute Circuit + */ + @JsonProperty(value = "circuit") + private Circuit circuit; + + /* + * The endpoints + */ + @JsonProperty(value = "endpoints", access = JsonProperty.Access.WRITE_ONLY) + private Endpoints endpoints; + + /* + * The block of addresses should be unique across VNet in your subscription + * as well as on-premise. Make sure the CIDR format is conformed to + * (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and + * 22 + */ + @JsonProperty(value = "networkBlock", required = true) + private String networkBlock; + + /* + * Network used to access vCenter Server and NSX-T Manager + */ + @JsonProperty(value = "managementNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String managementNetwork; + + /* + * Used for virtual machine cold migration, cloning, and snapshot migration + */ + @JsonProperty(value = "provisioningNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningNetwork; + + /* + * Used for live migration of virtual machines + */ + @JsonProperty(value = "vmotionNetwork", access = JsonProperty.Access.WRITE_ONLY) + private String vmotionNetwork; + + /* + * Optionally, set the vCenter admin password when the private cloud is + * created + */ + @JsonProperty(value = "vcenterPassword") + private String vcenterPassword; + + /* + * Optionally, set the NSX-T Manager password when the private cloud is + * created + */ + @JsonProperty(value = "nsxtPassword") + private String nsxtPassword; + + /* + * Thumbprint of the vCenter Server SSL certificate + */ + @JsonProperty(value = "vcenterCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String vcenterCertificateThumbprint; + + /* + * Thumbprint of the NSX-T Manager SSL certificate + */ + @JsonProperty(value = "nsxtCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String nsxtCertificateThumbprint; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public PrivateCloudProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the circuit property: An ExpressRoute Circuit. + * + * @return the circuit value. + */ + public Circuit circuit() { + return this.circuit; + } + + /** + * Set the circuit property: An ExpressRoute Circuit. + * + * @param circuit the circuit value to set. + * @return the PrivateCloudProperties object itself. + */ + public PrivateCloudProperties withCircuit(Circuit circuit) { + this.circuit = circuit; + return this; + } + + /** + * Get the endpoints property: The endpoints. + * + * @return the endpoints value. + */ + public Endpoints endpoints() { + return this.endpoints; + } + + /** + * Get the networkBlock property: The block of addresses should be unique across VNet in your subscription as well + * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X + * is between 0 and 22. + * + * @return the networkBlock value. + */ + public String networkBlock() { + return this.networkBlock; + } + + /** + * Set the networkBlock property: The block of addresses should be unique across VNet in your subscription as well + * as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X + * is between 0 and 22. + * + * @param networkBlock the networkBlock value to set. + * @return the PrivateCloudProperties object itself. + */ + public PrivateCloudProperties withNetworkBlock(String networkBlock) { + this.networkBlock = networkBlock; + return this; + } + + /** + * Get the managementNetwork property: Network used to access vCenter Server and NSX-T Manager. + * + * @return the managementNetwork value. + */ + public String managementNetwork() { + return this.managementNetwork; + } + + /** + * Get the provisioningNetwork property: Used for virtual machine cold migration, cloning, and snapshot migration. + * + * @return the provisioningNetwork value. + */ + public String provisioningNetwork() { + return this.provisioningNetwork; + } + + /** + * Get the vmotionNetwork property: Used for live migration of virtual machines. + * + * @return the vmotionNetwork value. + */ + public String vmotionNetwork() { + return this.vmotionNetwork; + } + + /** + * Get the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. + * + * @return the vcenterPassword value. + */ + public String vcenterPassword() { + return this.vcenterPassword; + } + + /** + * Set the vcenterPassword property: Optionally, set the vCenter admin password when the private cloud is created. + * + * @param vcenterPassword the vcenterPassword value to set. + * @return the PrivateCloudProperties object itself. + */ + public PrivateCloudProperties withVcenterPassword(String vcenterPassword) { + this.vcenterPassword = vcenterPassword; + return this; + } + + /** + * Get the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. + * + * @return the nsxtPassword value. + */ + public String nsxtPassword() { + return this.nsxtPassword; + } + + /** + * Set the nsxtPassword property: Optionally, set the NSX-T Manager password when the private cloud is created. + * + * @param nsxtPassword the nsxtPassword value to set. + * @return the PrivateCloudProperties object itself. + */ + public PrivateCloudProperties withNsxtPassword(String nsxtPassword) { + this.nsxtPassword = nsxtPassword; + return this; + } + + /** + * Get the vcenterCertificateThumbprint property: Thumbprint of the vCenter Server SSL certificate. + * + * @return the vcenterCertificateThumbprint value. + */ + public String vcenterCertificateThumbprint() { + return this.vcenterCertificateThumbprint; + } + + /** + * Get the nsxtCertificateThumbprint property: Thumbprint of the NSX-T Manager SSL certificate. + * + * @return the nsxtCertificateThumbprint value. + */ + public String nsxtCertificateThumbprint() { + return this.nsxtCertificateThumbprint; + } + + /** {@inheritDoc} */ + @Override + public PrivateCloudProperties withManagementCluster(ManagementCluster managementCluster) { + super.withManagementCluster(managementCluster); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateCloudProperties withInternet(InternetEnum internet) { + super.withInternet(internet); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateCloudProperties withIdentitySources(List identitySources) { + super.withIdentitySources(identitySources); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (circuit() != null) { + circuit().validate(); + } + if (endpoints() != null) { + endpoints().validate(); + } + if (networkBlock() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property networkBlock in model PrivateCloudProperties")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProvisioningState.java new file mode 100644 index 000000000000..3e68372ca785 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudProvisioningState.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateCloudProvisioningState. */ +public final class PrivateCloudProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState FAILED = fromString("Failed"); + + /** Static value Cancelled for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState CANCELLED = fromString("Cancelled"); + + /** Static value Pending for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState PENDING = fromString("Pending"); + + /** Static value Building for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for PrivateCloudProvisioningState. */ + public static final PrivateCloudProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a PrivateCloudProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateCloudProvisioningState. + */ + @JsonCreator + public static PrivateCloudProvisioningState fromString(String name) { + return fromString(name, PrivateCloudProvisioningState.class); + } + + /** @return known PrivateCloudProvisioningState values. */ + public static Collection values() { + return values(PrivateCloudProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java new file mode 100644 index 000000000000..16dc700121b5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdate.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** An update to a private cloud resource. */ +@JsonFlatten +@Fluent +public class PrivateCloudUpdate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudUpdate.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The default cluster used for management + */ + @JsonProperty(value = "properties.managementCluster") + private ManagementCluster managementCluster; + + /* + * Connectivity to internet is enabled or disabled + */ + @JsonProperty(value = "properties.internet") + private InternetEnum internet; + + /* + * vCenter Single Sign On Identity Sources + */ + @JsonProperty(value = "properties.identitySources") + private List identitySources; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the managementCluster property: The default cluster used for management. + * + * @return the managementCluster value. + */ + public ManagementCluster managementCluster() { + return this.managementCluster; + } + + /** + * Set the managementCluster property: The default cluster used for management. + * + * @param managementCluster the managementCluster value to set. + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withManagementCluster(ManagementCluster managementCluster) { + this.managementCluster = managementCluster; + return this; + } + + /** + * Get the internet property: Connectivity to internet is enabled or disabled. + * + * @return the internet value. + */ + public InternetEnum internet() { + return this.internet; + } + + /** + * Set the internet property: Connectivity to internet is enabled or disabled. + * + * @param internet the internet value to set. + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withInternet(InternetEnum internet) { + this.internet = internet; + return this; + } + + /** + * Get the identitySources property: vCenter Single Sign On Identity Sources. + * + * @return the identitySources value. + */ + public List identitySources() { + return this.identitySources; + } + + /** + * Set the identitySources property: vCenter Single Sign On Identity Sources. + * + * @param identitySources the identitySources value to set. + * @return the PrivateCloudUpdate object itself. + */ + public PrivateCloudUpdate withIdentitySources(List identitySources) { + this.identitySources = identitySources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementCluster() != null) { + managementCluster().validate(); + } + if (identitySources() != null) { + identitySources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdateProperties.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdateProperties.java new file mode 100644 index 000000000000..58c29842dc57 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudUpdateProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a private cloud resource that may be updated. */ +@Fluent +public class PrivateCloudUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateCloudUpdateProperties.class); + + /* + * The default cluster used for management + */ + @JsonProperty(value = "managementCluster") + private ManagementCluster managementCluster; + + /* + * Connectivity to internet is enabled or disabled + */ + @JsonProperty(value = "internet") + private InternetEnum internet; + + /* + * vCenter Single Sign On Identity Sources + */ + @JsonProperty(value = "identitySources") + private List identitySources; + + /** + * Get the managementCluster property: The default cluster used for management. + * + * @return the managementCluster value. + */ + public ManagementCluster managementCluster() { + return this.managementCluster; + } + + /** + * Set the managementCluster property: The default cluster used for management. + * + * @param managementCluster the managementCluster value to set. + * @return the PrivateCloudUpdateProperties object itself. + */ + public PrivateCloudUpdateProperties withManagementCluster(ManagementCluster managementCluster) { + this.managementCluster = managementCluster; + return this; + } + + /** + * Get the internet property: Connectivity to internet is enabled or disabled. + * + * @return the internet value. + */ + public InternetEnum internet() { + return this.internet; + } + + /** + * Set the internet property: Connectivity to internet is enabled or disabled. + * + * @param internet the internet value to set. + * @return the PrivateCloudUpdateProperties object itself. + */ + public PrivateCloudUpdateProperties withInternet(InternetEnum internet) { + this.internet = internet; + return this; + } + + /** + * Get the identitySources property: vCenter Single Sign On Identity Sources. + * + * @return the identitySources value. + */ + public List identitySources() { + return this.identitySources; + } + + /** + * Set the identitySources property: vCenter Single Sign On Identity Sources. + * + * @param identitySources the identitySources value to set. + * @return the PrivateCloudUpdateProperties object itself. + */ + public PrivateCloudUpdateProperties withIdentitySources(List identitySources) { + this.identitySources = identitySources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managementCluster() != null) { + managementCluster().validate(); + } + if (identitySources() != null) { + identitySources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java new file mode 100644 index 000000000000..f1eefd6da32a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateClouds.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 PrivateClouds. */ +public interface PrivateClouds { + /** + * List private clouds in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List private clouds in a 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 paged list of private clouds. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List private clouds in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + PagedIterable list(); + + /** + * List private clouds in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paged list of private clouds. + */ + PagedIterable list(Context context); + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + PrivateCloud getByResourceGroup(String resourceGroupName, String privateCloudName); + + /** + * Get a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String privateCloudName); + + /** + * Delete a private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateVcenterPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the vCenter password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateVcenterPassword(String resourceGroupName, String privateCloudName, Context context); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateNsxtPassword(String resourceGroupName, String privateCloudName); + + /** + * Rotate the NSX-T Manager password. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rotateNsxtPassword(String resourceGroupName, String privateCloudName, Context context); + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + AdminCredentials listAdminCredentials(String resourceGroupName, String privateCloudName); + + /** + * List the admin credentials for the private cloud. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return administrative credentials for accessing vCenter and NSX-T. + */ + Response listAdminCredentialsWithResponse( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a private cloud. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + PrivateCloud getById(String id); + + /** + * Get a private cloud. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private cloud. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a private cloud. + * + * @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); + + /** + * Delete a private cloud. + * + * @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 PrivateCloud resource. + * + * @param name resource name. + * @return the first stage of the new PrivateCloud definition. + */ + PrivateCloud.DefinitionStages.Blank define(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java new file mode 100644 index 000000000000..45af6f6e6119 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Quota.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.QuotaInner; +import java.util.Map; + +/** An immutable client-side representation of Quota. */ +public interface Quota { + /** + * Gets the hostsRemaining property: Remaining hosts quota by sku type. + * + * @return the hostsRemaining value. + */ + Map hostsRemaining(); + + /** + * Gets the quotaEnabled property: Host quota is active for current subscription. + * + * @return the quotaEnabled value. + */ + QuotaEnabled quotaEnabled(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.QuotaInner object. + * + * @return the inner object. + */ + QuotaInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.java new file mode 100644 index 000000000000..d5400779d0fd --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/QuotaEnabled.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for QuotaEnabled. */ +public final class QuotaEnabled extends ExpandableStringEnum { + /** Static value Enabled for QuotaEnabled. */ + public static final QuotaEnabled ENABLED = fromString("Enabled"); + + /** Static value Disabled for QuotaEnabled. */ + public static final QuotaEnabled DISABLED = fromString("Disabled"); + + /** + * Creates or finds a QuotaEnabled from its string representation. + * + * @param name a name to look for. + * @return the corresponding QuotaEnabled. + */ + @JsonCreator + public static QuotaEnabled fromString(String name) { + return fromString(name, QuotaEnabled.class); + } + + /** @return known QuotaEnabled values. */ + public static Collection values() { + return values(QuotaEnabled.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java new file mode 100644 index 000000000000..a9b24ffea6f5 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SegmentStatusEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SegmentStatusEnum. */ +public final class SegmentStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS, FAILURE for SegmentStatusEnum. */ + public static final SegmentStatusEnum SUCCESS_FAILURE = fromString("SUCCESS, FAILURE"); + + /** + * Creates or finds a SegmentStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SegmentStatusEnum. + */ + @JsonCreator + public static SegmentStatusEnum fromString(String name) { + return fromString(name, SegmentStatusEnum.class); + } + + /** @return known SegmentStatusEnum values. */ + public static Collection values() { + return values(SegmentStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ServiceSpecification.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ServiceSpecification.java new file mode 100644 index 000000000000..c2f563fa8c9a --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification payload. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Specifications of the Log for Azure Monitoring + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Specifications of the Metrics for Azure Monitoring + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.java new file mode 100644 index 000000000000..8c80da85983c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Sku.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition representing SKU. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The name of the SKU. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.java new file mode 100644 index 000000000000..9edb7bf99b49 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/SslEnum.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SslEnum. */ +public final class SslEnum extends ExpandableStringEnum { + /** Static value Enabled for SslEnum. */ + public static final SslEnum ENABLED = fromString("Enabled"); + + /** Static value Disabled for SslEnum. */ + public static final SslEnum DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SslEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding SslEnum. + */ + @JsonCreator + public static SslEnum fromString(String name) { + return fromString(name, SslEnum.class); + } + + /** @return known SslEnum values. */ + public static Collection values() { + return values(SslEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java new file mode 100644 index 000000000000..31f46a8f1a1e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/Trial.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.TrialInner; + +/** An immutable client-side representation of Trial. */ +public interface Trial { + /** + * Gets the status property: Trial status. + * + * @return the status value. + */ + TrialStatus status(); + + /** + * Gets the availableHosts property: Number of trial hosts available. + * + * @return the availableHosts value. + */ + Integer availableHosts(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.TrialInner object. + * + * @return the inner object. + */ + TrialInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java new file mode 100644 index 000000000000..c9340a3683f3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/TrialStatus.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrialStatus. */ +public final class TrialStatus extends ExpandableStringEnum { + /** Static value TrialAvailable for TrialStatus. */ + public static final TrialStatus TRIAL_AVAILABLE = fromString("TrialAvailable"); + + /** Static value TrialUsed for TrialStatus. */ + public static final TrialStatus TRIAL_USED = fromString("TrialUsed"); + + /** Static value TrialDisabled for TrialStatus. */ + public static final TrialStatus TRIAL_DISABLED = fromString("TrialDisabled"); + + /** + * Creates or finds a TrialStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrialStatus. + */ + @JsonCreator + public static TrialStatus fromString(String name) { + return fromString(name, TrialStatus.class); + } + + /** @return known TrialStatus values. */ + public static Collection values() { + return values(TrialStatus.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java new file mode 100644 index 000000000000..2bb961c1ff18 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMGroupStatusEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMGroupStatusEnum. */ +public final class VMGroupStatusEnum extends ExpandableStringEnum { + /** Static value SUCCESS, FAILURE for VMGroupStatusEnum. */ + public static final VMGroupStatusEnum SUCCESS_FAILURE = fromString("SUCCESS, FAILURE"); + + /** + * Creates or finds a VMGroupStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMGroupStatusEnum. + */ + @JsonCreator + public static VMGroupStatusEnum fromString(String name) { + return fromString(name, VMGroupStatusEnum.class); + } + + /** @return known VMGroupStatusEnum values. */ + public static Collection values() { + return values(VMGroupStatusEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java new file mode 100644 index 000000000000..6c92e2238673 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/VMTypeEnum.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VMTypeEnum. */ +public final class VMTypeEnum extends ExpandableStringEnum { + /** Static value REGULAR, EDGE, SERVICE for VMTypeEnum. */ + public static final VMTypeEnum REGULAR_EDGE_SERVICE = fromString("REGULAR, EDGE, SERVICE"); + + /** + * Creates or finds a VMTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding VMTypeEnum. + */ + @JsonCreator + public static VMTypeEnum fromString(String name) { + return fromString(name, VMTypeEnum.class); + } + + /** @return known VMTypeEnum values. */ + public static Collection values() { + return values(VMTypeEnum.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java new file mode 100644 index 000000000000..450fe31237e8 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcp.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkDhcp. */ +public interface WorkloadNetworkDhcp { + /** + * 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 displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the segments property: NSX Segments consuming DHCP. + * + * @return the segments value. + */ + List segments(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkDhcpProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner object. + * + * @return the inner object. + */ + WorkloadNetworkDhcpInner innerModel(); + + /** The entirety of the WorkloadNetworkDhcp definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkDhcp definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkDhcp definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkDhcp definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkDhcp 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.WithDisplayName, DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkDhcp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkDhcp create(Context context); + } + /** The stage of the WorkloadNetworkDhcp definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DHCP entity.. + * + * @param displayName Display name of the DHCP entity. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDhcp definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkDhcp resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkDhcp.Update update(); + + /** The template for WorkloadNetworkDhcp update. */ + interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkDhcp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkDhcp apply(Context context); + } + /** The WorkloadNetworkDhcp update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkDhcp update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DHCP entity.. + * + * @param displayName Display name of the DHCP entity. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDhcp update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkDhcp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkDhcp refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java new file mode 100644 index 000000000000..65e456dde323 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpEntity.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "dhcpType", + defaultImpl = WorkloadNetworkDhcpEntity.class) +@JsonTypeName("WorkloadNetworkDhcpEntity") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SERVER", value = WorkloadNetworkDhcpServer.class), + @JsonSubTypes.Type(name = "RELAY", value = WorkloadNetworkDhcpRelay.class) +}) +@Fluent +public class WorkloadNetworkDhcpEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpEntity.class); + + /* + * Display name of the DHCP entity. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * NSX Segments consuming DHCP. + */ + @JsonProperty(value = "segments", access = JsonProperty.Access.WRITE_ONLY) + private List segments; + + /* + * The provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private WorkloadNetworkDhcpProvisioningState provisioningState; + + /* + * NSX revision number. + */ + @JsonProperty(value = "revision") + private Long revision; + + /** + * Get the displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the DHCP entity. + * + * @param displayName the displayName value to set. + * @return the WorkloadNetworkDhcpEntity object itself. + */ + public WorkloadNetworkDhcpEntity withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the segments property: NSX Segments consuming DHCP. + * + * @return the segments value. + */ + public List segments() { + return this.segments; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public WorkloadNetworkDhcpProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the revision property: NSX revision number. + * + * @return the revision value. + */ + public Long revision() { + return this.revision; + } + + /** + * Set the revision property: NSX revision number. + * + * @param revision the revision value to set. + * @return the WorkloadNetworkDhcpEntity object itself. + */ + public WorkloadNetworkDhcpEntity withRevision(Long revision) { + this.revision = revision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java new file mode 100644 index 000000000000..72fb3d17f6bb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDhcpInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX dhcp entities. */ +@Immutable +public final class WorkloadNetworkDhcpList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.java new file mode 100644 index 000000000000..e39302dbb6ba --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkDhcpProvisioningState. */ +public final class WorkloadNetworkDhcpProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkDhcpProvisioningState. */ + public static final WorkloadNetworkDhcpProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkDhcpProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkDhcpProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkDhcpProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkDhcpProvisioningState.class); + } + + /** @return known WorkloadNetworkDhcpProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkDhcpProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java new file mode 100644 index 000000000000..626989e0a187 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpRelay.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** NSX DHCP Relay. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dhcpType") +@JsonTypeName("RELAY") +@Fluent +public final class WorkloadNetworkDhcpRelay extends WorkloadNetworkDhcpEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpRelay.class); + + /* + * DHCP Relay Addresses. Max 3. + */ + @JsonProperty(value = "serverAddresses") + private List serverAddresses; + + /** + * Get the serverAddresses property: DHCP Relay Addresses. Max 3. + * + * @return the serverAddresses value. + */ + public List serverAddresses() { + return this.serverAddresses; + } + + /** + * Set the serverAddresses property: DHCP Relay Addresses. Max 3. + * + * @param serverAddresses the serverAddresses value to set. + * @return the WorkloadNetworkDhcpRelay object itself. + */ + public WorkloadNetworkDhcpRelay withServerAddresses(List serverAddresses) { + this.serverAddresses = serverAddresses; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpRelay withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpRelay withRevision(Long revision) { + super.withRevision(revision); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java new file mode 100644 index 000000000000..397faeaeef06 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDhcpServer.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** NSX DHCP Server. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "dhcpType") +@JsonTypeName("SERVER") +@Fluent +public final class WorkloadNetworkDhcpServer extends WorkloadNetworkDhcpEntity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDhcpServer.class); + + /* + * DHCP Server Address. + */ + @JsonProperty(value = "serverAddress") + private String serverAddress; + + /* + * DHCP Server Lease Time. + */ + @JsonProperty(value = "leaseTime") + private Long leaseTime; + + /** + * Get the serverAddress property: DHCP Server Address. + * + * @return the serverAddress value. + */ + public String serverAddress() { + return this.serverAddress; + } + + /** + * Set the serverAddress property: DHCP Server Address. + * + * @param serverAddress the serverAddress value to set. + * @return the WorkloadNetworkDhcpServer object itself. + */ + public WorkloadNetworkDhcpServer withServerAddress(String serverAddress) { + this.serverAddress = serverAddress; + return this; + } + + /** + * Get the leaseTime property: DHCP Server Lease Time. + * + * @return the leaseTime value. + */ + public Long leaseTime() { + return this.leaseTime; + } + + /** + * Set the leaseTime property: DHCP Server Lease Time. + * + * @param leaseTime the leaseTime value to set. + * @return the WorkloadNetworkDhcpServer object itself. + */ + public WorkloadNetworkDhcpServer withLeaseTime(Long leaseTime) { + this.leaseTime = leaseTime; + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpServer withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkloadNetworkDhcpServer withRevision(Long revision) { + super.withRevision(revision); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java new file mode 100644 index 000000000000..2f676481ae73 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsService.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkDnsService. */ +public interface WorkloadNetworkDnsService { + /** + * 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 displayName property: Display name of the DNS Service. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the dnsServiceIp property: DNS service IP of the DNS Service. + * + * @return the dnsServiceIp value. + */ + String dnsServiceIp(); + + /** + * Gets the defaultDnsZone property: Default DNS zone of the DNS Service. + * + * @return the defaultDnsZone value. + */ + String defaultDnsZone(); + + /** + * Gets the fqdnZones property: FQDN zones of the DNS Service. + * + * @return the fqdnZones value. + */ + List fqdnZones(); + + /** + * Gets the logLevel property: DNS Service log level. + * + * @return the logLevel value. + */ + DnsServiceLogLevelEnum logLevel(); + + /** + * Gets the status property: DNS Service status. + * + * @return the status value. + */ + DnsServiceStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkDnsServiceProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner object. + * + * @return the inner object. + */ + WorkloadNetworkDnsServiceInner innerModel(); + + /** The entirety of the WorkloadNetworkDnsService definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkDnsService definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkDnsService definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkDnsService 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.WithDisplayName, + DefinitionStages.WithDnsServiceIp, + DefinitionStages.WithDefaultDnsZone, + DefinitionStages.WithFqdnZones, + DefinitionStages.WithLogLevel, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkDnsService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkDnsService create(Context context); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Service.. + * + * @param displayName Display name of the DNS Service. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify dnsServiceIp. */ + interface WithDnsServiceIp { + /** + * Specifies the dnsServiceIp property: DNS service IP of the DNS Service.. + * + * @param dnsServiceIp DNS service IP of the DNS Service. + * @return the next definition stage. + */ + WithCreate withDnsServiceIp(String dnsServiceIp); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify defaultDnsZone. */ + interface WithDefaultDnsZone { + /** + * Specifies the defaultDnsZone property: Default DNS zone of the DNS Service.. + * + * @param defaultDnsZone Default DNS zone of the DNS Service. + * @return the next definition stage. + */ + WithCreate withDefaultDnsZone(String defaultDnsZone); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify fqdnZones. */ + interface WithFqdnZones { + /** + * Specifies the fqdnZones property: FQDN zones of the DNS Service.. + * + * @param fqdnZones FQDN zones of the DNS Service. + * @return the next definition stage. + */ + WithCreate withFqdnZones(List fqdnZones); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify logLevel. */ + interface WithLogLevel { + /** + * Specifies the logLevel property: DNS Service log level.. + * + * @param logLevel DNS Service log level. + * @return the next definition stage. + */ + WithCreate withLogLevel(DnsServiceLogLevelEnum logLevel); + } + /** The stage of the WorkloadNetworkDnsService definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkDnsService resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkDnsService.Update update(); + + /** The template for WorkloadNetworkDnsService update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDnsServiceIp, + UpdateStages.WithDefaultDnsZone, + UpdateStages.WithFqdnZones, + UpdateStages.WithLogLevel, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkDnsService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkDnsService apply(Context context); + } + /** The WorkloadNetworkDnsService update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkDnsService update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Service.. + * + * @param displayName Display name of the DNS Service. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify dnsServiceIp. */ + interface WithDnsServiceIp { + /** + * Specifies the dnsServiceIp property: DNS service IP of the DNS Service.. + * + * @param dnsServiceIp DNS service IP of the DNS Service. + * @return the next definition stage. + */ + Update withDnsServiceIp(String dnsServiceIp); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify defaultDnsZone. */ + interface WithDefaultDnsZone { + /** + * Specifies the defaultDnsZone property: Default DNS zone of the DNS Service.. + * + * @param defaultDnsZone Default DNS zone of the DNS Service. + * @return the next definition stage. + */ + Update withDefaultDnsZone(String defaultDnsZone); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify fqdnZones. */ + interface WithFqdnZones { + /** + * Specifies the fqdnZones property: FQDN zones of the DNS Service.. + * + * @param fqdnZones FQDN zones of the DNS Service. + * @return the next definition stage. + */ + Update withFqdnZones(List fqdnZones); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify logLevel. */ + interface WithLogLevel { + /** + * Specifies the logLevel property: DNS Service log level.. + * + * @param logLevel DNS Service log level. + * @return the next definition stage. + */ + Update withLogLevel(DnsServiceLogLevelEnum logLevel); + } + /** The stage of the WorkloadNetworkDnsService update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkDnsService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkDnsService refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.java new file mode 100644 index 000000000000..20291ed0b3b3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServiceProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkDnsServiceProvisioningState. */ +public final class WorkloadNetworkDnsServiceProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkDnsServiceProvisioningState. */ + public static final WorkloadNetworkDnsServiceProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkDnsServiceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkDnsServiceProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkDnsServiceProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkDnsServiceProvisioningState.class); + } + + /** @return known WorkloadNetworkDnsServiceProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkDnsServiceProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java new file mode 100644 index 000000000000..f4c5c46e39e3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsServicesList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX DNS Services. */ +@Immutable +public final class WorkloadNetworkDnsServicesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsServicesList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java new file mode 100644 index 000000000000..a454a6d9cb49 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZone.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkDnsZone. */ +public interface WorkloadNetworkDnsZone { + /** + * 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 displayName property: Display name of the DNS Zone. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the domain property: Domain names of the DNS Zone. + * + * @return the domain value. + */ + List domain(); + + /** + * Gets the dnsServerIps property: DNS Server IP array of the DNS Zone. + * + * @return the dnsServerIps value. + */ + List dnsServerIps(); + + /** + * Gets the sourceIp property: Source IP of the DNS Zone. + * + * @return the sourceIp value. + */ + String sourceIp(); + + /** + * Gets the dnsServices property: Number of DNS Services using the DNS zone. + * + * @return the dnsServices value. + */ + Long dnsServices(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkDnsZoneProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner object. + * + * @return the inner object. + */ + WorkloadNetworkDnsZoneInner innerModel(); + + /** The entirety of the WorkloadNetworkDnsZone definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkDnsZone definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkDnsZone definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkDnsZone 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.WithDisplayName, + DefinitionStages.WithDomain, + DefinitionStages.WithDnsServerIps, + DefinitionStages.WithSourceIp, + DefinitionStages.WithDnsServices, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkDnsZone create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkDnsZone create(Context context); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Zone.. + * + * @param displayName Display name of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify domain. */ + interface WithDomain { + /** + * Specifies the domain property: Domain names of the DNS Zone.. + * + * @param domain Domain names of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withDomain(List domain); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify dnsServerIps. */ + interface WithDnsServerIps { + /** + * Specifies the dnsServerIps property: DNS Server IP array of the DNS Zone.. + * + * @param dnsServerIps DNS Server IP array of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withDnsServerIps(List dnsServerIps); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify sourceIp. */ + interface WithSourceIp { + /** + * Specifies the sourceIp property: Source IP of the DNS Zone.. + * + * @param sourceIp Source IP of the DNS Zone. + * @return the next definition stage. + */ + WithCreate withSourceIp(String sourceIp); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify dnsServices. */ + interface WithDnsServices { + /** + * Specifies the dnsServices property: Number of DNS Services using the DNS zone.. + * + * @param dnsServices Number of DNS Services using the DNS zone. + * @return the next definition stage. + */ + WithCreate withDnsServices(Long dnsServices); + } + /** The stage of the WorkloadNetworkDnsZone definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkDnsZone resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkDnsZone.Update update(); + + /** The template for WorkloadNetworkDnsZone update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDomain, + UpdateStages.WithDnsServerIps, + UpdateStages.WithSourceIp, + UpdateStages.WithDnsServices, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkDnsZone apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkDnsZone apply(Context context); + } + /** The WorkloadNetworkDnsZone update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkDnsZone update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the DNS Zone.. + * + * @param displayName Display name of the DNS Zone. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify domain. */ + interface WithDomain { + /** + * Specifies the domain property: Domain names of the DNS Zone.. + * + * @param domain Domain names of the DNS Zone. + * @return the next definition stage. + */ + Update withDomain(List domain); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify dnsServerIps. */ + interface WithDnsServerIps { + /** + * Specifies the dnsServerIps property: DNS Server IP array of the DNS Zone.. + * + * @param dnsServerIps DNS Server IP array of the DNS Zone. + * @return the next definition stage. + */ + Update withDnsServerIps(List dnsServerIps); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify sourceIp. */ + interface WithSourceIp { + /** + * Specifies the sourceIp property: Source IP of the DNS Zone.. + * + * @param sourceIp Source IP of the DNS Zone. + * @return the next definition stage. + */ + Update withSourceIp(String sourceIp); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify dnsServices. */ + interface WithDnsServices { + /** + * Specifies the dnsServices property: Number of DNS Services using the DNS zone.. + * + * @param dnsServices Number of DNS Services using the DNS zone. + * @return the next definition stage. + */ + Update withDnsServices(Long dnsServices); + } + /** The stage of the WorkloadNetworkDnsZone update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkDnsZone refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkDnsZone refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.java new file mode 100644 index 000000000000..899f54f56add --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZoneProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkDnsZoneProvisioningState. */ +public final class WorkloadNetworkDnsZoneProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkDnsZoneProvisioningState. */ + public static final WorkloadNetworkDnsZoneProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkDnsZoneProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkDnsZoneProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkDnsZoneProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkDnsZoneProvisioningState.class); + } + + /** @return known WorkloadNetworkDnsZoneProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkDnsZoneProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java new file mode 100644 index 000000000000..34011c3aaa23 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkDnsZonesList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX DNS Zones. */ +@Immutable +public final class WorkloadNetworkDnsZonesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkDnsZonesList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.java new file mode 100644 index 000000000000..c65b3101945e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGateway.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.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; + +/** An immutable client-side representation of WorkloadNetworkGateway. */ +public interface WorkloadNetworkGateway { + /** + * 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 displayName property: Display name of the DHCP entity. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the path property: NSX Gateway Path. + * + * @return the path value. + */ + String path(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner object. + * + * @return the inner object. + */ + WorkloadNetworkGatewayInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java new file mode 100644 index 000000000000..530b25c7cdf9 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkGatewayList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkGatewayInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Gateways. */ +@Immutable +public final class WorkloadNetworkGatewayList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkGatewayList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java new file mode 100644 index 000000000000..b09cf54104c0 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroring.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; + +/** An immutable client-side representation of WorkloadNetworkPortMirroring. */ +public interface WorkloadNetworkPortMirroring { + /** + * 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 displayName property: Display name of the port mirroring profile. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the direction property: Direction of port mirroring profile. + * + * @return the direction value. + */ + PortMirroringDirectionEnum direction(); + + /** + * Gets the source property: Source VM Group. + * + * @return the source value. + */ + String source(); + + /** + * Gets the destination property: Destination VM Group. + * + * @return the destination value. + */ + String destination(); + + /** + * Gets the status property: Port Mirroring Status. + * + * @return the status value. + */ + PortMirroringStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkPortMirroringProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner object. + * + * @return the inner object. + */ + WorkloadNetworkPortMirroringInner innerModel(); + + /** The entirety of the WorkloadNetworkPortMirroring definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkPortMirroring definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkPortMirroring definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkPortMirroring 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.WithDisplayName, + DefinitionStages.WithDirection, + DefinitionStages.WithSource, + DefinitionStages.WithDestination, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkPortMirroring create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkPortMirroring create(Context context); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the port mirroring profile.. + * + * @param displayName Display name of the port mirroring profile. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: Direction of port mirroring profile.. + * + * @param direction Direction of port mirroring profile. + * @return the next definition stage. + */ + WithCreate withDirection(PortMirroringDirectionEnum direction); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source VM Group.. + * + * @param source Source VM Group. + * @return the next definition stage. + */ + WithCreate withSource(String source); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Destination VM Group.. + * + * @param destination Destination VM Group. + * @return the next definition stage. + */ + WithCreate withDestination(String destination); + } + /** The stage of the WorkloadNetworkPortMirroring definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkPortMirroring resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkPortMirroring.Update update(); + + /** The template for WorkloadNetworkPortMirroring update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithDirection, + UpdateStages.WithSource, + UpdateStages.WithDestination, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkPortMirroring apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkPortMirroring apply(Context context); + } + /** The WorkloadNetworkPortMirroring update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the port mirroring profile.. + * + * @param displayName Display name of the port mirroring profile. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify direction. */ + interface WithDirection { + /** + * Specifies the direction property: Direction of port mirroring profile.. + * + * @param direction Direction of port mirroring profile. + * @return the next definition stage. + */ + Update withDirection(PortMirroringDirectionEnum direction); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source VM Group.. + * + * @param source Source VM Group. + * @return the next definition stage. + */ + Update withSource(String source); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Destination VM Group.. + * + * @param destination Destination VM Group. + * @return the next definition stage. + */ + Update withDestination(String destination); + } + /** The stage of the WorkloadNetworkPortMirroring update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkPortMirroring refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkPortMirroring refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java new file mode 100644 index 000000000000..e82f73dc4031 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Port Mirroring. */ +@Immutable +public final class WorkloadNetworkPortMirroringList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkPortMirroringList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.java new file mode 100644 index 000000000000..74622a41bd16 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkPortMirroringProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkPortMirroringProvisioningState. */ +public final class WorkloadNetworkPortMirroringProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkPortMirroringProvisioningState. */ + public static final WorkloadNetworkPortMirroringProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkPortMirroringProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkPortMirroringProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkPortMirroringProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkPortMirroringProvisioningState.class); + } + + /** @return known WorkloadNetworkPortMirroringProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkPortMirroringProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java new file mode 100644 index 000000000000..a2ff84fb48a3 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegment.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkSegment. */ +public interface WorkloadNetworkSegment { + /** + * 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 displayName property: Display name of the segment. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the connectedGateway property: Gateway which to connect segment to. + * + * @return the connectedGateway value. + */ + String connectedGateway(); + + /** + * Gets the subnet property: Subnet which to connect segment to. + * + * @return the subnet value. + */ + WorkloadNetworkSegmentSubnet subnet(); + + /** + * Gets the portVif property: Port Vif which segment is associated with. + * + * @return the portVif value. + */ + List portVif(); + + /** + * Gets the status property: Segment status. + * + * @return the status value. + */ + SegmentStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkSegmentProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner object. + * + * @return the inner object. + */ + WorkloadNetworkSegmentInner innerModel(); + + /** The entirety of the WorkloadNetworkSegment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkSegment definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkSegment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkSegment 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.WithDisplayName, + DefinitionStages.WithConnectedGateway, + DefinitionStages.WithSubnet, + DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkSegment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkSegment create(Context context); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the segment.. + * + * @param displayName Display name of the segment. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify connectedGateway. */ + interface WithConnectedGateway { + /** + * Specifies the connectedGateway property: Gateway which to connect segment to.. + * + * @param connectedGateway Gateway which to connect segment to. + * @return the next definition stage. + */ + WithCreate withConnectedGateway(String connectedGateway); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: Subnet which to connect segment to.. + * + * @param subnet Subnet which to connect segment to. + * @return the next definition stage. + */ + WithCreate withSubnet(WorkloadNetworkSegmentSubnet subnet); + } + /** The stage of the WorkloadNetworkSegment definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkSegment resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkSegment.Update update(); + + /** The template for WorkloadNetworkSegment update. */ + interface Update + extends UpdateStages.WithDisplayName, + UpdateStages.WithConnectedGateway, + UpdateStages.WithSubnet, + UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkSegment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkSegment apply(Context context); + } + /** The WorkloadNetworkSegment update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkSegment update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the segment.. + * + * @param displayName Display name of the segment. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkSegment update allowing to specify connectedGateway. */ + interface WithConnectedGateway { + /** + * Specifies the connectedGateway property: Gateway which to connect segment to.. + * + * @param connectedGateway Gateway which to connect segment to. + * @return the next definition stage. + */ + Update withConnectedGateway(String connectedGateway); + } + /** The stage of the WorkloadNetworkSegment update allowing to specify subnet. */ + interface WithSubnet { + /** + * Specifies the subnet property: Subnet which to connect segment to.. + * + * @param subnet Subnet which to connect segment to. + * @return the next definition stage. + */ + Update withSubnet(WorkloadNetworkSegmentSubnet subnet); + } + /** The stage of the WorkloadNetworkSegment update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkSegment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkSegment refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.java new file mode 100644 index 000000000000..c310126fd773 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentPortVif.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ports and any VIF attached to segment. */ +@Fluent +public final class WorkloadNetworkSegmentPortVif { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentPortVif.class); + + /* + * Name of port or VIF attached to segment. + */ + @JsonProperty(value = "portName") + private String portName; + + /** + * Get the portName property: Name of port or VIF attached to segment. + * + * @return the portName value. + */ + public String portName() { + return this.portName; + } + + /** + * Set the portName property: Name of port or VIF attached to segment. + * + * @param portName the portName value to set. + * @return the WorkloadNetworkSegmentPortVif object itself. + */ + public WorkloadNetworkSegmentPortVif withPortName(String portName) { + this.portName = portName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.java new file mode 100644 index 000000000000..454ae0b71e6e --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkSegmentProvisioningState. */ +public final class WorkloadNetworkSegmentProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkSegmentProvisioningState. */ + public static final WorkloadNetworkSegmentProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkSegmentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkSegmentProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkSegmentProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkSegmentProvisioningState.class); + } + + /** @return known WorkloadNetworkSegmentProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkSegmentProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.java new file mode 100644 index 000000000000..0d434e1c740d --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentSubnet.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.avs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Subnet configuration for segment. */ +@Fluent +public final class WorkloadNetworkSegmentSubnet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentSubnet.class); + + /* + * DHCP Range assigned for subnet. + */ + @JsonProperty(value = "dhcpRanges") + private List dhcpRanges; + + /* + * Gateway address. + */ + @JsonProperty(value = "gatewayAddress") + private String gatewayAddress; + + /** + * Get the dhcpRanges property: DHCP Range assigned for subnet. + * + * @return the dhcpRanges value. + */ + public List dhcpRanges() { + return this.dhcpRanges; + } + + /** + * Set the dhcpRanges property: DHCP Range assigned for subnet. + * + * @param dhcpRanges the dhcpRanges value to set. + * @return the WorkloadNetworkSegmentSubnet object itself. + */ + public WorkloadNetworkSegmentSubnet withDhcpRanges(List dhcpRanges) { + this.dhcpRanges = dhcpRanges; + return this; + } + + /** + * Get the gatewayAddress property: Gateway address. + * + * @return the gatewayAddress value. + */ + public String gatewayAddress() { + return this.gatewayAddress; + } + + /** + * Set the gatewayAddress property: Gateway address. + * + * @param gatewayAddress the gatewayAddress value to set. + * @return the WorkloadNetworkSegmentSubnet object itself. + */ + public WorkloadNetworkSegmentSubnet withGatewayAddress(String gatewayAddress) { + this.gatewayAddress = gatewayAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java new file mode 100644 index 000000000000..aef9594abc79 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkSegmentsList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkSegmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Segments. */ +@Immutable +public final class WorkloadNetworkSegmentsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkSegmentsList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java new file mode 100644 index 000000000000..18438fad3f05 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroup.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import java.util.List; + +/** An immutable client-side representation of WorkloadNetworkVMGroup. */ +public interface WorkloadNetworkVMGroup { + /** + * 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 displayName property: Display name of the VM group. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the members property: Virtual machine members of this group. + * + * @return the members value. + */ + List members(); + + /** + * Gets the status property: VM Group status. + * + * @return the status value. + */ + VMGroupStatusEnum status(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + WorkloadNetworkVMGroupProvisioningState provisioningState(); + + /** + * Gets the revision property: NSX revision number. + * + * @return the revision value. + */ + Long revision(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner object. + * + * @return the inner object. + */ + WorkloadNetworkVMGroupInner innerModel(); + + /** The entirety of the WorkloadNetworkVMGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadNetworkVMGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadNetworkVMGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, privateCloudName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @return the next definition stage. + */ + WithCreate withExistingPrivateCloud(String resourceGroupName, String privateCloudName); + } + /** + * The stage of the WorkloadNetworkVMGroup 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.WithDisplayName, DefinitionStages.WithMembers, DefinitionStages.WithRevision { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadNetworkVMGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadNetworkVMGroup create(Context context); + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the VM group.. + * + * @param displayName Display name of the VM group. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify members. */ + interface WithMembers { + /** + * Specifies the members property: Virtual machine members of this group.. + * + * @param members Virtual machine members of this group. + * @return the next definition stage. + */ + WithCreate withMembers(List members); + } + /** The stage of the WorkloadNetworkVMGroup definition allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + WithCreate withRevision(Long revision); + } + } + /** + * Begins update for the WorkloadNetworkVMGroup resource. + * + * @return the stage of resource update. + */ + WorkloadNetworkVMGroup.Update update(); + + /** The template for WorkloadNetworkVMGroup update. */ + interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithMembers, UpdateStages.WithRevision { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadNetworkVMGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadNetworkVMGroup apply(Context context); + } + /** The WorkloadNetworkVMGroup update stages. */ + interface UpdateStages { + /** The stage of the WorkloadNetworkVMGroup update allowing to specify displayName. */ + interface WithDisplayName { + /** + * Specifies the displayName property: Display name of the VM group.. + * + * @param displayName Display name of the VM group. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + /** The stage of the WorkloadNetworkVMGroup update allowing to specify members. */ + interface WithMembers { + /** + * Specifies the members property: Virtual machine members of this group.. + * + * @param members Virtual machine members of this group. + * @return the next definition stage. + */ + Update withMembers(List members); + } + /** The stage of the WorkloadNetworkVMGroup update allowing to specify revision. */ + interface WithRevision { + /** + * Specifies the revision property: NSX revision number.. + * + * @param revision NSX revision number. + * @return the next definition stage. + */ + Update withRevision(Long revision); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadNetworkVMGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadNetworkVMGroup refresh(Context context); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.java new file mode 100644 index 000000000000..b848504b44cb --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupProvisioningState.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.avs.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkloadNetworkVMGroupProvisioningState. */ +public final class WorkloadNetworkVMGroupProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState FAILED = fromString("Failed"); + + /** Static value Building for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState BUILDING = fromString("Building"); + + /** Static value Deleting for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for WorkloadNetworkVMGroupProvisioningState. */ + public static final WorkloadNetworkVMGroupProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkloadNetworkVMGroupProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadNetworkVMGroupProvisioningState. + */ + @JsonCreator + public static WorkloadNetworkVMGroupProvisioningState fromString(String name) { + return fromString(name, WorkloadNetworkVMGroupProvisioningState.class); + } + + /** @return known WorkloadNetworkVMGroupProvisioningState values. */ + public static Collection values() { + return values(WorkloadNetworkVMGroupProvisioningState.class); + } +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java new file mode 100644 index 000000000000..ac5458a9d235 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVMGroupsList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX VM Groups. */ +@Immutable +public final class WorkloadNetworkVMGroupsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVMGroupsList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.java new file mode 100644 index 000000000000..f55adc8d68fc --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachine.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.avs.models; + +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; + +/** An immutable client-side representation of WorkloadNetworkVirtualMachine. */ +public interface WorkloadNetworkVirtualMachine { + /** + * 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 displayName property: Display name of the VM. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the vmType property: Virtual machine type. + * + * @return the vmType value. + */ + VMTypeEnum vmType(); + + /** + * Gets the inner com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner object. + * + * @return the inner object. + */ + WorkloadNetworkVirtualMachineInner innerModel(); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java new file mode 100644 index 000000000000..8201046cd9c4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworkVirtualMachinesList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVirtualMachineInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of NSX Virtual Machines. */ +@Immutable +public final class WorkloadNetworkVirtualMachinesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadNetworkVirtualMachinesList.class); + + /* + * The items on the page + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next page if any + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The items on the page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next page if 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/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java new file mode 100644 index 000000000000..bfe27f76378c --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/WorkloadNetworks.java @@ -0,0 +1,908 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.avs.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 WorkloadNetworks. */ +public interface WorkloadNetworks { + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + PagedIterable listSegments(String resourceGroupName, String privateCloudName); + + /** + * List of segments in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Segments. + */ + PagedIterable listSegments( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + WorkloadNetworkSegment getSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + Response getSegmentWithResponse( + String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param segmentId NSX Segment identifier. Generally the same as the Segment's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteSegment(String resourceGroupName, String privateCloudName, String segmentId, Context context); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + PagedIterable listDhcp(String resourceGroupName, String privateCloudName); + + /** + * List dhcp in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX dhcp entities. + */ + PagedIterable listDhcp(String resourceGroupName, String privateCloudName, Context context); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + WorkloadNetworkDhcp getDhcp(String resourceGroupName, String dhcpId, String privateCloudName); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dhcp by id in a private cloud workload network. + */ + Response getDhcpWithResponse( + String resourceGroupName, String dhcpId, String privateCloudName, Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dhcpId NSX DHCP identifier. Generally the same as the DHCP display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDhcp(String resourceGroupName, String privateCloudName, String dhcpId, Context context); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + PagedIterable listGateways(String resourceGroupName, String privateCloudName); + + /** + * List of gateways in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Gateways. + */ + PagedIterable listGateways( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + WorkloadNetworkGateway getGateway(String resourceGroupName, String privateCloudName, String gatewayId); + + /** + * Get a gateway by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param gatewayId NSX Gateway identifier. Generally the same as the Gateway's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a gateway by id in a private cloud workload network. + */ + Response getGatewayWithResponse( + String resourceGroupName, String privateCloudName, String gatewayId, Context context); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + PagedIterable listPortMirroring(String resourceGroupName, String privateCloudName); + + /** + * List of port mirroring profiles in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Port Mirroring. + */ + PagedIterable listPortMirroring( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + WorkloadNetworkPortMirroring getPortMirroring( + String resourceGroupName, String privateCloudName, String portMirroringId); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + Response getPortMirroringWithResponse( + String resourceGroupName, String privateCloudName, String portMirroringId, Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePortMirroring(String resourceGroupName, String portMirroringId, String privateCloudName); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param portMirroringId NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deletePortMirroring( + String resourceGroupName, String portMirroringId, String privateCloudName, Context context); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + PagedIterable listVMGroups(String resourceGroupName, String privateCloudName); + + /** + * List of vm groups in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX VM Groups. + */ + PagedIterable listVMGroups( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + WorkloadNetworkVMGroup getVMGroup(String resourceGroupName, String privateCloudName, String vmGroupId); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + Response getVMGroupWithResponse( + String resourceGroupName, String privateCloudName, String vmGroupId, Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vmGroupId NSX VM Group identifier. Generally the same as the VM Group's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteVMGroup(String resourceGroupName, String vmGroupId, String privateCloudName, Context context); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + PagedIterable listVirtualMachines(String resourceGroupName, String privateCloudName); + + /** + * List of virtual machines in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX Virtual Machines. + */ + PagedIterable listVirtualMachines( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + WorkloadNetworkVirtualMachine getVirtualMachine( + String resourceGroupName, String privateCloudName, String virtualMachineId); + + /** + * Get a virtual machine by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param virtualMachineId NSX Virtual Machine identifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a virtual machine by id in a private cloud workload network. + */ + Response getVirtualMachineWithResponse( + String resourceGroupName, String privateCloudName, String virtualMachineId, Context context); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + PagedIterable listDnsServices(String resourceGroupName, String privateCloudName); + + /** + * List of DNS services in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Services. + */ + PagedIterable listDnsServices( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + WorkloadNetworkDnsService getDnsService(String resourceGroupName, String privateCloudName, String dnsServiceId); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + Response getDnsServiceWithResponse( + String resourceGroupName, String privateCloudName, String dnsServiceId, Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsServiceId NSX DNS Service identifier. Generally the same as the DNS Service's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDnsService(String resourceGroupName, String dnsServiceId, String privateCloudName, Context context); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + PagedIterable listDnsZones(String resourceGroupName, String privateCloudName); + + /** + * List of DNS zones in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of NSX DNS Zones. + */ + PagedIterable listDnsZones( + String resourceGroupName, String privateCloudName, Context context); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + WorkloadNetworkDnsZone getDnsZone(String resourceGroupName, String privateCloudName, String dnsZoneId); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateCloudName Name of the private cloud. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + Response getDnsZoneWithResponse( + String resourceGroupName, String privateCloudName, String dnsZoneId, Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name. + * @param privateCloudName Name of the private cloud. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteDnsZone(String resourceGroupName, String dnsZoneId, String privateCloudName, Context context); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + WorkloadNetworkSegment getSegmentById(String id); + + /** + * Get a segment by id in a private cloud workload network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a segment by id in a private cloud workload network. + */ + Response getSegmentByIdWithResponse(String id, Context context); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @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 dhcp by id in a private cloud workload network. + */ + WorkloadNetworkDhcp getDhcpById(String id); + + /** + * Get dhcp by id in a private cloud workload network. + * + * @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 dhcp by id in a private cloud workload network. + */ + Response getDhcpByIdWithResponse(String id, Context context); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + WorkloadNetworkPortMirroring getPortMirroringById(String id); + + /** + * Get a port mirroring profile by id in a private cloud workload network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a port mirroring profile by id in a private cloud workload network. + */ + Response getPortMirroringByIdWithResponse(String id, Context context); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + WorkloadNetworkVMGroup getVMGroupById(String id); + + /** + * Get a vm group by id in a private cloud workload network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vm group by id in a private cloud workload network. + */ + Response getVMGroupByIdWithResponse(String id, Context context); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + WorkloadNetworkDnsService getDnsServiceById(String id); + + /** + * Get a DNS service by id in a private cloud workload network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS service by id in a private cloud workload network. + */ + Response getDnsServiceByIdWithResponse(String id, Context context); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + WorkloadNetworkDnsZone getDnsZoneById(String id); + + /** + * Get a DNS zone by id in a private cloud workload network. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a DNS zone by id in a private cloud workload network. + */ + Response getDnsZoneByIdWithResponse(String id, Context context); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @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 deleteSegmentById(String id); + + /** + * Delete a segment by id in a private cloud workload network. + * + * @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 deleteSegmentByIdWithResponse(String id, Context context); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @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 deleteDhcpById(String id); + + /** + * Delete dhcp by id in a private cloud workload network. + * + * @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 deleteDhcpByIdWithResponse(String id, Context context); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @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 deletePortMirroringById(String id); + + /** + * Delete a port mirroring profile by id in a private cloud workload network. + * + * @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 deletePortMirroringByIdWithResponse(String id, Context context); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @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 deleteVMGroupById(String id); + + /** + * Delete a vm group by id in a private cloud workload network. + * + * @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 deleteVMGroupByIdWithResponse(String id, Context context); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @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 deleteDnsServiceById(String id); + + /** + * Delete a DNS service by id in a private cloud workload network. + * + * @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 deleteDnsServiceByIdWithResponse(String id, Context context); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @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 deleteDnsZoneById(String id); + + /** + * Delete a DNS zone by id in a private cloud workload network. + * + * @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 deleteDnsZoneByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkloadNetworkSegment resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkSegment definition. + */ + WorkloadNetworkSegment.DefinitionStages.Blank defineSegments(String name); + + /** + * Begins definition for a new WorkloadNetworkDhcp resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkDhcp definition. + */ + WorkloadNetworkDhcp.DefinitionStages.Blank defineDhcp(String name); + + /** + * Begins definition for a new WorkloadNetworkPortMirroring resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkPortMirroring definition. + */ + WorkloadNetworkPortMirroring.DefinitionStages.Blank definePortMirroring(String name); + + /** + * Begins definition for a new WorkloadNetworkVMGroup resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkVMGroup definition. + */ + WorkloadNetworkVMGroup.DefinitionStages.Blank defineVMGroup(String name); + + /** + * Begins definition for a new WorkloadNetworkDnsService resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkDnsService definition. + */ + WorkloadNetworkDnsService.DefinitionStages.Blank defineDnsService(String name); + + /** + * Begins definition for a new WorkloadNetworkDnsZone resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadNetworkDnsZone definition. + */ + WorkloadNetworkDnsZone.DefinitionStages.Blank defineDnsZone(String name); +} diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/package-info.java new file mode 100644 index 000000000000..a1dcabeca8f4 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/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 AvsClient. Azure VMware Solution API. */ +package com.azure.resourcemanager.avs.models; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/package-info.java new file mode 100644 index 000000000000..33dfd5e58c76 --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/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 AvsClient. Azure VMware Solution API. */ +package com.azure.resourcemanager.avs; diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/module-info.java new file mode 100644 index 000000000000..57505781a0ae --- /dev/null +++ b/sdk/avs/azure-resourcemanager-avs/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.avs { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.avs; + exports com.azure.resourcemanager.avs.fluent; + exports com.azure.resourcemanager.avs.fluent.models; + exports com.azure.resourcemanager.avs.models; + + opens com.azure.resourcemanager.avs.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.avs.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/avs/ci.yml b/sdk/avs/ci.yml new file mode 100644 index 000000000000..ecd276e503e9 --- /dev/null +++ b/sdk/avs/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: avs + Artifacts: + - name: azure-resourcemanager-avs + groupId: com.azure.resourcemanager + safeName: azureresourcemanageravs diff --git a/sdk/avs/pom.xml b/sdk/avs/pom.xml new file mode 100644 index 000000000000..0a73218b03c6 --- /dev/null +++ b/sdk/avs/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-avs-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-avs + + + +